Skip to content

Commit 369f4e8

Browse files
Merge branch 'master' into daniel.mohedano/fix-junit5-report-entry-forwarding
2 parents f20c893 + fdbfc96 commit 369f4e8

424 files changed

Lines changed: 5479 additions & 3215 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/perf-review/references/checks.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Format: **pattern** — *expensive when (the interprocedural condition to trace)
2525
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.
2626
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.
2727
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.
28-
8. **`@NoEscape` field-storage violation** — *a field (instance or static, directly or as a generic type argument) declared with an `@NoEscape`-annotated type (`datadog.trace.api.function.NoEscape`), **or** initialized directly from a call to an `@NoEscape`-annotated method — with no comment at the declaration justifying the retention*. The type form marks a concrete type (e.g. `SubSequence`); the method form exists for a return value whose concrete type can't itself carry the annotation (an anonymous class or lambda implementing a JDK interface). The annotation's own javadoc carries a self-contained "Checker contract" section (trigger / not-a-trigger / violation example / compliant example, both forms) written so this can be checked from the diff alone, with no other context needed. The underlying rule is "should", not "must" (RFC-2119 sense): a trigger is a presumptive finding, not an automatic failure — a field with a `// Retained on purpose: <reason>`-style comment is compliant. **flag-with-confidence** — SEV-2/3 (SEV-1 if the annotated type/method shares backing storage with something large, per its own javadoc). Current wearers: `SubSequence`, `Maybe` (type form; see J7 below for `SubSequence`'s specific retention-vs-transient discriminator). **No lint enforces this yet — the AI reviewer is the only check, so this stays here (not under deterministic-lint candidates below) until a checker lands and it can migrate down.**
28+
8. **`@NoEscape` field-storage violation** — *a field (instance or static, directly or as a generic type argument) declared with an `@NoEscape`-annotated type (`datadog.trace.api.function.NoEscape`), **or** initialized directly from a call to an `@NoEscape`-annotated method — with no comment at the declaration justifying the retention*. The type form marks a concrete type (e.g. `SubSequence`); the method form exists for a return value whose concrete type can't itself carry the annotation (an anonymous class or lambda implementing a JDK interface). The annotation's own javadoc carries a self-contained "Checker contract" section (trigger / not-a-trigger / violation example / compliant example, both forms) written so this can be checked from the diff alone, with no other context needed. The underlying rule is "should", not "must" (RFC-2119 sense): a trigger is a presumptive finding, not an automatic failure — compliant if the declaration carries either a `// Retained on purpose: <reason>`-style comment, or `@SuppressPerfContract(value = NoEscape.class, reason = "...")` (`datadog.perfcontract.SuppressPerfContract` — the generic exemption mechanism shared by every perf-contract marker, not `@NoEscape`-specific), or a named canned-exception annotation itself meta-annotated `@SuppressPerfContract` with `NoEscape.class` among its `value` (e.g. a hypothetical `@Borrowed`) — treat the meta-annotation's own `reason` as satisfying the requirement. Don't flag a `SuppressPerfContract`/canned-exception use as non-compliant just for being terse; that mirrors the annotation's own Checker contract. **flag-with-confidence** — SEV-2/3 (SEV-1 if the annotated type/method shares backing storage with something large, per its own javadoc). Current wearers: `SubSequence`, `Maybe` (type form; see J7 below for `SubSequence`'s specific retention-vs-transient discriminator). **No lint enforces this yet — the AI reviewer is the only check, so this stays here (not under deterministic-lint candidates below) until a checker lands and it can migrate down.**
2929

3030
## Deterministic-lint candidates (DON'T spend AI budget — make these real lints)
3131
Fixed-signature, mechanically checkable:

‎.github/CODEOWNERS‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
/internal-api/src/*/*/datadog/trace/api/env/ @DataDog/apm-java
8888
/internal-api/src/*/*/datadog/trace/api/flare/ @DataDog/apm-java
8989
/internal-api/src/*/*/datadog/trace/api/function/ @DataDog/apm-java
90+
/internal-api/src/*/*/datadog/perfcontract/ @DataDog/apm-java
9091
/internal-api/src/*/*/datadog/trace/api/intake/ @DataDog/apm-java
9192
/internal-api/src/*/*/datadog/trace/api/logging/ @DataDog/apm-java
9293
/internal-api/src/*/*/datadog/trace/api/metrics/ @DataDog/apm-java
@@ -174,6 +175,8 @@
174175
/dd-java-agent/instrumentation/azure-functions-1.2.2/ @DataDog/apm-serverless
175176

176177
# @DataDog/apm-lang-platform-java
178+
/.agents/skills/fix-continuation-leakage/ @DataDog/apm-lang-platform-java
179+
/.claude/skills/fix-continuation-leakage/ @DataDog/apm-lang-platform-java
177180
/.editorconfig @DataDog/apm-lang-platform-java
178181
/.githooks/ @DataDog/apm-lang-platform-java
179182
/.github/ @DataDog/apm-lang-platform-java
@@ -191,6 +194,7 @@
191194
/dd-java-agent/agent-installer/ @DataDog/apm-lang-platform-java
192195
/dd-java-agent/agent-tooling/ @DataDog/apm-lang-platform-java
193196
/dd-java-agent/instrumentation-annotation-processor/ @DataDog/apm-lang-platform-java
197+
/dd-java-agent/instrumentation-testing/src/*/java/datadog/trace/agent/test/scopediag/ @DataDog/apm-lang-platform-java
194198
/dd-java-agent/src/ @DataDog/apm-lang-platform-java
195199
/dd-smoke-tests/concurrent/ @DataDog/apm-lang-platform-java
196200
/dd-smoke-tests/field-injection/ @DataDog/apm-lang-platform-java

‎.gitlab/BENCHMARKS.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Benchmarks
2+
3+
GitLab CI configuration for the benchmarks that run on the
4+
[Benchmarking Platform](https://datadoghq.atlassian.net/wiki/spaces/APMINT/pages/2419261562/Benchmarking+Platform).
5+
6+
## Layout
7+
8+
- `benchmarks.yml`: dsm-kafka and debugger benchmarks.
9+
- `dsm-kafka-producer-benchmark` and `dsm-kafka-consumer-benchmark` extend
10+
`.dsm-kafka-benchmarks`.
11+
- Run JMH microbenchmarks via `bp-runner`, then convert, upload and comment on the PR.
12+
- Steps live in the `java/kafka-dsm-overhead` branch of
13+
[benchmarking-platform](https://github.com/DataDog/benchmarking-platform).
14+
- `debugger-benchmarks`: k6 load test against Spring petclinic.
15+
- Runs via `bp-runner`, then converts, uploads and comments on the PR.
16+
- Steps live in the `java/debugger-benchmarks` branch of
17+
[benchmarking-platform](https://github.com/DataDog/benchmarking-platform).
18+
- `java-benchmark-configs.yml`: `needs` and `rules` overrides for the spring-petclinic,
19+
insecure-bank, startup and dacapo parallel jobs included from
20+
[apm-sdks-benchmarks](https://github.com/DataDog/apm-sdks-benchmarks/tree/main/.gitlab).
21+
- Change the jobs themselves there.
22+
23+
## Marking a benchmark as flaky
24+
25+
Add it to `FLAKY_BENCHMARKS_REGEX` in the suite's file:
26+
27+
- dsm-kafka: `.dsm-kafka-benchmarks` in `benchmarks.yml`.
28+
- debugger: `debugger-benchmarks` in `benchmarks.yml`.
29+
30+
The benchmark still runs and reports, but doesn't fail performance quality gates, such as the
31+
SLO-based `*-check-slo-breaches` jobs of the apm-sdks-benchmarks suites.
32+
33+
- The regex matches anywhere in the scenario name.
34+
- `KafkaConsumerBenchmark` quarantines every `KafkaConsumerBenchmark` method across
35+
configurations.
36+
- Anchor with `^...$` to target one scenario.
37+
38+
```yaml
39+
FLAKY_BENCHMARKS_REGEX: "^only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark\\.benchConsume$"
40+
```
41+
42+
Open a ticket to fix or remove it. See
43+
[Flaky Benchmarks Monitoring](https://datadoghq.atlassian.net/wiki/spaces/APMINT/pages/7223313012/Flaky+Benchmarks+Monitoring).

‎.gitlab/benchmarks.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built.
3434
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA # The commit revision the project is built for.
3535
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: "true"
36+
# See https://datadoghq.atlassian.net/wiki/spaces/APMINT/pages/7223313012/Flaky+Benchmarks+Monitoring for more details.
37+
FLAKY_BENCHMARKS_REGEX: ""
3638

3739
dsm-kafka-producer-benchmark:
3840
extends: .dsm-kafka-benchmarks
@@ -80,3 +82,5 @@ debugger-benchmarks:
8082
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built.
8183
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA # The commit revision the project is built for.
8284
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: "true"
85+
# See https://datadoghq.atlassian.net/wiki/spaces/APMINT/pages/7223313012/Flaky+Benchmarks+Monitoring for more details.
86+
FLAKY_BENCHMARKS_REGEX: ""

‎dd-java-agent/agent-iast/build.gradle‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ plugins {
1010
id 'dd-trace-java.module.product-subsystem'
1111
}
1212

13-
tasks.named("compileJava", JavaCompile) {
14-
configureCompiler(it, 11, JavaVersion.VERSION_1_8, "Error Prone 2.23.0 / NullAway 0.10.15 are incompatible with JDK 25 javac")
15-
}
16-
1713
// First version with Mac M1 support
1814
def grpcVersion = '1.42.2'
1915
protobuf {
@@ -66,8 +62,8 @@ dependencies {
6662
jmh project(':dd-java-agent:instrumentation:java:java-lang:java-lang-1.8')
6763

6864
compileOnly('org.jetbrains:annotations:24.0.0')
69-
errorprone('com.uber.nullaway:nullaway:0.10.15')
70-
errorprone('com.google.errorprone:error_prone_core:2.23.0')
65+
errorprone('com.uber.nullaway:nullaway:0.14.2')
66+
errorprone('com.google.errorprone:error_prone_core:2.50.0')
7167
}
7268

7369
tasks.named("shadowJar", ShadowJar) {
@@ -117,6 +113,7 @@ tasks.named("forbiddenApisJmh") {
117113

118114
tasks.withType(JavaCompile).configureEach {
119115
if (name == 'compileJava') {
116+
options.compilerArgs.add('--should-stop=ifError=FLOW')
120117
options.errorprone {
121118
check("NullAway", CheckSeverity.ERROR)
122119
option("NullAway:AnnotatedPackages", "com.datadog.iast")

0 commit comments

Comments
 (0)