Skip to content

Commit 2986321

Browse files
committed
Merge remote-tracking branch 'origin/dougqh/control-tag-cardinality' into dougqh/metrics-memory-efficiency
2 parents d3095aa + e61f9cd commit 2986321

239 files changed

Lines changed: 10813 additions & 8400 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.

.claude/skills/add-apm-integrations/SKILL.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ pattern before writing new code. Use it as a template.
6363
- `testImplementation` dependencies for tests
6464
- `muzzle { pass { } }` directives (see Step 9)
6565
4. Register the new module in `settings.gradle.kts` in **alphabetical order**
66+
5. Register the integration name in `metadata/supported-configurations.json`, or
67+
`checkInstrumenterModuleConfigurations` fails. The name in `super(...)` maps to env var
68+
`DD_TRACE_<NAME>_ENABLED` (`.` and `-` become `_`, uppercased — `couchbase-3`
69+
`DD_TRACE_COUCHBASE_3_ENABLED`). Add a `"type": "boolean"` entry, in alphabetical order, with
70+
aliases `DD_TRACE_INTEGRATION_<NAME>_ENABLED` and `DD_INTEGRATION_<NAME>_ENABLED`. Set `default`
71+
to the module's real default — `"true"`, or `"false"` if it overrides `defaultEnabled()` (e.g.
72+
OpenTelemetry, Hazelcast). Declaring several names (`super("a", "b")`) means one entry each.
6673

6774
## Step 5 – Write the InstrumenterModule
6875

@@ -193,11 +200,15 @@ Run these commands in order and fix any failures before proceeding:
193200
./gradlew :dd-java-agent:instrumentation:$framework-$version:muzzle
194201
./gradlew :dd-java-agent:instrumentation:$framework-$version:test
195202
./gradlew :dd-java-agent:instrumentation:$framework-$version:latestDepTest
203+
./gradlew checkInstrumenterModuleConfigurations
196204
./gradlew spotlessCheck
197205
```
198206

199207
**If muzzle fails:** check for missing helper class names in `helperClassNames()`.
200208

209+
**If `checkInstrumenterModuleConfigurations` fails:** an integration name from `super(...)` is missing
210+
(or mismatched) in `metadata/supported-configurations.json` — see Step 4, item 5.
211+
201212
**If tests fail:** verify span lifecycle order (start → activate → error → finish → close), helper registration,
202213
and `contextStore()` map entries match actual usage.
203214

@@ -208,6 +219,7 @@ and `contextStore()` map entries match actual usage.
208219
Output this checklist and confirm each item is satisfied:
209220

210221
- [ ] `settings.gradle.kts` entry added in alphabetical order
222+
- [ ] `metadata/supported-configurations.json` has a `DD_TRACE_<NAME>_ENABLED` entry (+ the two aliases) for every name passed to `super(...)`
211223
- [ ] `build.gradle` has `compileOnly` deps and `muzzle` directives with `assertInverse = true`
212224
- [ ] `@AutoService(InstrumenterModule.class)` annotation present on the module class
213225
- [ ] `helperClassNames()` lists ALL referenced helpers (including inner, anonymous, and enum synthetic classes)

.claude/skills/migrate-groovy-to-java/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ When converting Groovy code to Java code, make sure that:
3030
- Do not mark local variables `final`
3131
- Ensure variables are human-readable; avoid single-letter names and pre-define variables that are referenced multiple times
3232
- When translating Spock `Mock(...)` usage, use `libs.bundles.mockito` instead of writing manual recording/stub implementations
33+
- 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.
3334
- Keep inline comments
3435
- Migrate the named Spock clauses if they exist as inline comments in the Java unit test
3536

.github/CODEOWNERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
/dd-smoke-tests/vertx-*/ @DataDog/apm-idm-java
2222
/dd-smoke-tests/wildfly/ @DataDog/apm-idm-java
2323

24+
# @DataDog/apm-release-platform
25+
/.gitlab/ @DataDog/apm-release-platform @DataDog/apm-lang-platform-java
26+
/.gitlab-ci.yml @DataDog/apm-release-platform @DataDog/apm-lang-platform-java
27+
2428
# @DataDog/apm-sdk-capabilities-java
2529
/dd-java-agent/agent-otel @DataDog/apm-sdk-capabilities-java
2630
/dd-smoke-tests/log-injection @DataDog/apm-sdk-capabilities-java
@@ -52,8 +56,6 @@
5256

5357
# @DataDog/apm-lang-platform-java
5458
/.github/ @DataDog/apm-lang-platform-java
55-
/.gitlab/ @DataDog/apm-lang-platform-java
56-
/.gitlab-ci.yml @DataDog/apm-lang-platform-java
5759
/benchmark/ @DataDog/apm-lang-platform-java
5860
/components/ @DataDog/apm-lang-platform-java
5961
/dd-java-agent/instrumentation/java/ @DataDog/apm-lang-platform-java

.github/scripts/dependency_age.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,10 @@ def build_validation_summary(
452452
if old_gav not in seen:
453453
seen.add(old_gav)
454454
if new_gav in baseline_coords:
455-
continue # no-op downgrade — replacement matches baseline
456-
lines.append(f"- `{old_gav}` is {hours_remaining}h away from meeting {min_age_hours}h cooldown, updated to `{new_gav}`")
455+
lines.append(f"- `{old_gav}` is {hours_remaining}h away from meeting {min_age_hours}h cooldown, reverted")
456+
else:
457+
new_version = new_gav.rsplit(":", 1)[1]
458+
lines.append(f"- `{old_gav}` is {hours_remaining}h away from meeting {min_age_hours}h cooldown, updated to `{new_version}`")
457459
for entries in violations_by_file.values():
458460
for gav, kind, hours_remaining in entries:
459461
if gav not in seen:
@@ -462,8 +464,6 @@ def build_validation_summary(
462464
lines.append(f"- `{gav}` — cannot verify age, reverted")
463465
else:
464466
lines.append(f"- `{gav}` is {hours_remaining}h away from meeting {min_age_hours}h cooldown, reverted")
465-
if len(lines) == 2:
466-
return "" # only header, no entries after filtering
467467
return "\n".join(lines)
468468

469469

.github/workflows/analyze-changes.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
${{ runner.os }}-gradle-
3131
3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
33+
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
3434
with:
3535
languages: 'java'
3636
build-mode: 'manual'
@@ -43,7 +43,7 @@ jobs:
4343
./gradlew clean :dd-java-agent:shadowJar --build-cache --parallel --stacktrace --no-daemon --max-workers=4
4444
4545
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
46-
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
46+
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
4747

4848
trivy:
4949
name: Analyze changes with Trivy
@@ -102,7 +102,7 @@ jobs:
102102
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
103103

104104
- name: Upload Trivy scan results to GitHub Security tab
105-
uses: github/codeql-action/upload-sarif@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
105+
uses: github/codeql-action/upload-sarif@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
106106
if: always()
107107
with:
108108
sarif_file: 'trivy-results.sarif'

.github/workflows/prune-old-pull-requests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
pull-requests: write
1414
steps:
1515
- name: Prune old pull requests
16-
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
16+
uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
1717
with:
1818
days-before-stale: -1 # Disable general stale bot
1919
days-before-pr-stale: 90 # Only enable stale bot for PRs with no activity for 90 days

.gitlab-ci.yml

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ default:
161161
fi
162162
163163
echo -e "${TEXT_BOLD}${TEXT_YELLOW}Runner dashboard, these are live (limited to a 1-hour window, and expire after 36 hours)${TEXT_CLEAR}"
164-
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"
165-
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"
164+
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"
165+
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"
166166
167167
.gitlab_base_ref_params: &gitlab_base_ref_params
168168
- |
@@ -548,7 +548,15 @@ check_debugger:
548548

549549
muzzle:
550550
extends: .gradle_build
551-
needs: [ build_tests ]
551+
# needs:parallel:matrix limits this job to a specific build_tests combination.
552+
# Keep matrix vars exact and in build_tests declaration order:
553+
# https://docs.gitlab.com/ci/yaml/#needsparallelmatrix
554+
needs: &needs_build_tests_inst
555+
- job: build_tests
556+
parallel:
557+
matrix:
558+
- GRADLE_TARGET: ":instrumentationTest"
559+
CACHE_TYPE: "inst"
552560
stage: tests
553561
rules:
554562
- if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/'
@@ -586,7 +594,7 @@ muzzle:
586594

587595
muzzle-dep-report:
588596
extends: .gradle_build
589-
needs: [ build_tests ]
597+
needs: *needs_build_tests_inst
590598
stage: tests
591599
rules:
592600
- if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/'
@@ -737,6 +745,15 @@ agent_integration_tests:
737745

738746
test_base:
739747
extends: .test_job
748+
# needs:parallel:matrix limits this job to a specific build_tests combination.
749+
# Keep matrix vars exact and in build_tests declaration order:
750+
# https://docs.gitlab.com/ci/yaml/#needsparallelmatrix
751+
needs:
752+
- job: build_tests
753+
parallel:
754+
matrix:
755+
- GRADLE_TARGET: ":baseTest"
756+
CACHE_TYPE: "base"
740757
variables:
741758
GRADLE_TARGET: ":baseTest"
742759
CACHE_TYPE: "base"
@@ -748,6 +765,7 @@ test_base:
748765

749766
test_inst:
750767
extends: .test_job_with_test_agent
768+
needs: *needs_build_tests_inst
751769
variables:
752770
GRADLE_TARGET: ":instrumentationTest"
753771
CACHE_TYPE: "inst"
@@ -756,6 +774,15 @@ test_inst:
756774

757775
test_inst_latest:
758776
extends: .test_job_with_test_agent
777+
# needs:parallel:matrix limits this job to a specific build_tests combination.
778+
# Keep matrix vars exact and in build_tests declaration order:
779+
# https://docs.gitlab.com/ci/yaml/#needsparallelmatrix
780+
needs:
781+
- job: build_tests
782+
parallel:
783+
matrix:
784+
- GRADLE_TARGET: ":instrumentationLatestDepTest"
785+
CACHE_TYPE: "latestdep"
759786
variables:
760787
GRADLE_TARGET: ":instrumentationLatestDepTest"
761788
CACHE_TYPE: "latestdep"
@@ -786,6 +813,7 @@ test_flaky:
786813

787814
test_flaky_inst:
788815
extends: .test_job
816+
needs: *needs_build_tests_inst
789817
variables:
790818
GRADLE_TARGET: ":instrumentationTest"
791819
GRADLE_PARAMS: "-PrunFlakyTests"
@@ -800,6 +828,15 @@ test_flaky_inst:
800828

801829
test_profiling:
802830
extends: .test_job
831+
# needs:parallel:matrix limits this job to a specific build_tests combination.
832+
# Keep matrix vars exact and in build_tests declaration order:
833+
# https://docs.gitlab.com/ci/yaml/#needsparallelmatrix
834+
needs:
835+
- job: build_tests
836+
parallel:
837+
matrix:
838+
- GRADLE_TARGET: ":profilingTest"
839+
CACHE_TYPE: "profiling"
803840
variables:
804841
GRADLE_TARGET: ":profilingTest"
805842
CACHE_TYPE: "profiling"
@@ -819,6 +856,16 @@ test_debugger:
819856

820857
test_smoke:
821858
extends: .test_job
859+
# needs:parallel:matrix limits this job to a specific build_tests combination.
860+
# Keep matrix vars exact and in build_tests declaration order:
861+
# https://docs.gitlab.com/ci/yaml/#needsparallelmatrix
862+
needs: &needs_build_tests_smoke
863+
- job: build_tests
864+
parallel:
865+
matrix:
866+
- GRADLE_TARGET: ":smokeTest"
867+
CACHE_TYPE: "smoke"
868+
MAVEN_OPTS: "-Xms256M -Xmx1024M"
822869
variables:
823870
GRADLE_TARGET: "stageMainDist :smokeTest"
824871
GRADLE_PARAMS: "-PskipFlakyTests"
@@ -828,6 +875,7 @@ test_smoke:
828875

829876
test_ssi_smoke:
830877
extends: .test_job
878+
needs: *needs_build_tests_smoke
831879
rules:
832880
- if: $CI_COMMIT_BRANCH == "master"
833881
when: on_success
@@ -845,9 +893,10 @@ test_ssi_smoke:
845893

846894
test_smoke_graalvm:
847895
extends: .test_job
896+
needs: *needs_build_tests_smoke
848897
tags: [ "arch:amd64" ]
849898
variables:
850-
GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test"
899+
GRADLE_TARGET: "stageMainDist :dd-smoke-test:spring-boot-3.0-native:test :dd-smoke-test:quarkus-native:test"
851900
CACHE_TYPE: "smoke"
852901
CI_NO_SPLIT: "true"
853902
NON_DEFAULT_JVMS: "true"
@@ -857,6 +906,7 @@ test_smoke_graalvm:
857906

858907
test_smoke_semeru8_debugger:
859908
extends: .test_job
909+
needs: *needs_build_tests_smoke
860910
tags: [ "arch:amd64" ]
861911
variables:
862912
GRADLE_TARGET: "stageMainDist dd-smoke-tests:debugger-integration-tests:test"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package datadog.buildlogic.smoketest
2+
3+
import java.net.URI
4+
5+
internal const val MASS_READ_URL_ENV = "MASS_READ_URL"
6+
7+
internal fun gradleDistributionUri(massReadUrl: String, gradleVersion: String): URI {
8+
val baseUrl = if (massReadUrl.endsWith("/")) massReadUrl else "$massReadUrl/"
9+
return URI.create(
10+
"${baseUrl}internal/artifact/services.gradle.org/distributions/gradle-$gradleVersion-bin.zip",
11+
)
12+
}

0 commit comments

Comments
 (0)