Skip to content

Commit 25257d0

Browse files
authored
Merge branch 'master' into ygree/fix-play-jaxrs-resource-name-priority
2 parents a4d72e4 + 3853c65 commit 25257d0

File tree

9 files changed

+148
-16
lines changed

9 files changed

+148
-16
lines changed

.github/workflows/analyze-changes.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
${{ runner.os }}-gradle-
4141
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
43+
uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
4444
with:
4545
languages: 'java'
4646
build-mode: 'manual'
@@ -57,7 +57,7 @@ jobs:
5757
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5858
5959
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
60-
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
60+
uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
6161

6262
trivy:
6363
name: Analyze changes with Trivy
@@ -109,7 +109,7 @@ jobs:
109109
ls -laR "./workspace/.trivy"
110110
111111
- name: Run Trivy security scanner
112-
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
112+
uses: aquasecurity/trivy-action@76071ef0d7ec797419534a183b498b4d6366cf37 # v0.31.0
113113
with:
114114
scan-type: rootfs
115115
scan-ref: './workspace/.trivy/'
@@ -122,7 +122,7 @@ jobs:
122122
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
123123

124124
- name: Upload Trivy scan results to GitHub Security tab
125-
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
125+
uses: github/codeql-action/upload-sarif@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
126126
if: always()
127127
with:
128128
sarif_file: 'trivy-results.sarif'

.github/workflows/check-ci-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Run Ensure CI Success
26-
uses: DataDog/ensure-ci-success@727e7fe39ae2e1ce7ea336ec85a7369ab0731754
26+
uses: DataDog/ensure-ci-success@4a4b720e881d965254a9de2a4f14d1ec0c3d0d7c
2727
with:
2828
initial-delay-seconds: "500"
2929
max-retries: "60"

.gitlab-ci.yml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ variables:
4848
- "21"
4949
- "semeru11"
5050
- "oracle8"
51-
- "ubuntu17"
5251
- "zulu8"
5352
- "semeru8"
5453
- "ibm8"
@@ -96,6 +95,12 @@ default:
9695
- ONE_INDEXED_NODE_INDEX=${CI_NODE_INDEX:-1}; export NORMALIZED_NODE_INDEX=$((ONE_INDEXED_NODE_INDEX - 1))
9796
- echo "NORMALIZED_NODE_TOTAL=${NORMALIZED_NODE_TOTAL}, NORMALIZED_NODE_INDEX=$NORMALIZED_NODE_INDEX"
9897

98+
.cgroup_info: &cgroup_info
99+
- source .gitlab/gitlab-utils.sh
100+
- gitlab_section_start "cgroup-info" "cgroup info"
101+
- .gitlab/cgroup-info.sh
102+
- gitlab_section_end "cgroup-info"
103+
99104
.gradle_build: &gradle_build
100105
image: ghcr.io/datadog/dd-trace-java-docker-build:${BUILDER_IMAGE_VERSION_PREFIX}base
101106
stage: build
@@ -141,6 +146,8 @@ default:
141146
- mv .gradle-copy .gradle
142147
- ls -la
143148
- gitlab_section_end "gradle-dance"
149+
after_script:
150+
- *cgroup_info
144151

145152
build:
146153
extends: .gradle_build
@@ -218,6 +225,38 @@ populate_dep_cache:
218225
# - GRADLE_TARGET: ":smokeTest"
219226
# CACHE_TYPE: "smoke"
220227

228+
publish-artifacts-to-s3:
229+
image: registry.ddbuild.io/images/mirror/amazon/aws-cli:2.4.29
230+
stage: publish
231+
needs: [ build ]
232+
script:
233+
- source upstream.env
234+
- export VERSION="${UPSTREAM_TRACER_VERSION%~*}" # remove ~githash from the end of version
235+
- aws s3 cp workspace/dd-java-agent/build/libs/dd-java-agent-${VERSION}.jar s3://dd-trace-java-builds/${CI_COMMIT_REF_NAME}/dd-java-agent.jar
236+
- aws s3 cp workspace/dd-trace-api/build/libs/dd-trace-api-${VERSION}.jar s3://dd-trace-java-builds/${CI_COMMIT_REF_NAME}/dd-trace-api.jar
237+
- aws s3 cp workspace/dd-trace-ot/build/libs/dd-trace-ot-${VERSION}.jar s3://dd-trace-java-builds/${CI_COMMIT_REF_NAME}/dd-trace-ot.jar
238+
- aws s3 cp workspace/dd-java-agent/build/libs/dd-java-agent-${VERSION}.jar s3://dd-trace-java-builds/${CI_PIPELINE_ID}/dd-java-agent.jar
239+
- aws s3 cp workspace/dd-trace-api/build/libs/dd-trace-api-${VERSION}.jar s3://dd-trace-java-builds/${CI_PIPELINE_ID}/dd-trace-api.jar
240+
- aws s3 cp workspace/dd-trace-ot/build/libs/dd-trace-ot-${VERSION}.jar s3://dd-trace-java-builds/${CI_PIPELINE_ID}/dd-trace-ot.jar
241+
- |
242+
cat << EOF > links.json
243+
{
244+
"S3 Links": [
245+
{
246+
"external_link": {
247+
"label": "Public Link to dd-java-agent.jar",
248+
"url": "https://s3.us-east-1.amazonaws.com/dd-trace-java-builds/${CI_PIPELINE_ID}/dd-java-agent.jar"
249+
}
250+
}
251+
]
252+
}
253+
EOF
254+
artifacts:
255+
reports:
256+
annotations:
257+
- links.json
258+
259+
221260
spotless:
222261
extends: .gradle_build
223262
stage: tests
@@ -244,6 +283,7 @@ test_published_artifacts:
244283
- export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx1G -Xms1G -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
245284
- ./gradlew check --info $GRADLE_ARGS
246285
after_script:
286+
- *cgroup_info
247287
- source .gitlab/gitlab-utils.sh
248288
- gitlab_section_start "collect-reports" "Collecting reports"
249289
- .circleci/collect_reports.sh
@@ -262,6 +302,7 @@ test_published_artifacts:
262302
script:
263303
- ./gradlew $GRADLE_TARGET -PskipTests -PrunBuildSrcTests -PskipSpotless -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS
264304
after_script:
305+
- *cgroup_info
265306
- source .gitlab/gitlab-utils.sh
266307
- gitlab_section_start "collect-reports" "Collecting reports"
267308
- .circleci/collect_reports.sh --destination ./check_reports --move
@@ -322,6 +363,7 @@ muzzle:
322363
- split --number=l/$NORMALIZED_NODE_TOTAL --suffix-length=1 --numeric-suffixes sortedMuzzleTasks muzzleSplit
323364
- ./gradlew `cat muzzleSplit${NORMALIZED_NODE_INDEX} | xargs` $GRADLE_ARGS
324365
after_script:
366+
- *cgroup_info
325367
- source .gitlab/gitlab-utils.sh
326368
- gitlab_section_start "collect-reports" "Collecting reports"
327369
- .circleci/collect_reports.sh
@@ -342,6 +384,7 @@ muzzle-dep-report:
342384
- export SKIP_BUILDSCAN="true"
343385
- ./gradlew generateMuzzleReport muzzleInstrumentationReport $GRADLE_ARGS
344386
after_script:
387+
- *cgroup_info
345388
- .circleci/collect_muzzle_deps.sh
346389
artifacts:
347390
when: always
@@ -401,6 +444,7 @@ muzzle-dep-report:
401444
after_script:
402445
- *restore_pretest_env
403446
- *set_datadog_api_keys
447+
- *cgroup_info
404448
- source .gitlab/gitlab-utils.sh
405449
- gitlab_section_start "collect-reports" "Collecting reports"
406450
- .circleci/collect_reports.sh

.gitlab/benchmarks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
timeout: 1h
55
tags: ["runner:apm-k8s-tweaked-metal"]
66
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-java-benchmarks
7-
needs: [ "build" ]
7+
needs: [ "build", "publish-artifacts-to-s3" ]
88
rules:
99
- if: '$POPULATE_CACHE'
1010
when: never
@@ -85,7 +85,7 @@ benchmarks-post-results:
8585
interruptible: true
8686
timeout: 1h
8787
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:java-dsm-kafka
88-
needs: [ "build" ]
88+
needs: [ "build", "publish-artifacts-to-s3"]
8989
script:
9090
- git clone --branch java/kafka-dsm-overhead https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform.git platform && cd platform
9191
- ./steps/run-benchmarks.sh
@@ -129,7 +129,7 @@ debugger-benchmarks:
129129
interruptible: true
130130
timeout: 1h
131131
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:java-debugger
132-
needs: ["build"]
132+
needs: ["build", "publish-artifacts-to-s3"]
133133
script:
134134
- export ARTIFACTS_DIR="$(pwd)/reports" && mkdir -p "${ARTIFACTS_DIR}"
135135
- git clone --branch java/debugger-benchmarks https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform.git /platform && cd /platform

.gitlab/cgroup-info.sh

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/usr/bin/env bash
2+
3+
print_metric() {
4+
local label="$1"
5+
local raw_value="$2"
6+
local trimmed_value
7+
8+
# Use read -rd '' to trim leading/trailing IFS whitespace (space, tab, newline)
9+
read -rd '' trimmed_value <<< "$raw_value" || :
10+
11+
# Check if trimmed_value contains a newline character for formatting
12+
if [[ "$trimmed_value" == *$'\n'* ]]; then
13+
local indent=" "
14+
# Using a more robust way to handle potential leading/trailing newlines in raw_value for printf
15+
printf "%-35s :\n" "$label"
16+
printf "%s\n" "$indent${trimmed_value//$'\n'/$'\n'$indent}" # Indent and print the value on new lines
17+
else
18+
printf "%-35s : %s\n" "$label" "$trimmed_value"
19+
fi
20+
}
21+
22+
cat_file() {
23+
cat "$1" 2>/dev/null || echo 'not found'
24+
}
25+
26+
# Show cgroup memory usage
27+
print_metric "RAM memory" "$( (grep MemTotal /proc/meminfo | tr -s ' ' | cut -d ' ' -f 2) 2>/dev/null || echo 'not found')"
28+
29+
if [ -f /sys/fs/cgroup/cgroup.controllers ]; then
30+
# cgroup v2
31+
print_metric "cgroup v2 memory.peak" "$(cat_file /sys/fs/cgroup/memory.peak)"
32+
print_metric "cgroup v2 memory.max" "$(cat_file /sys/fs/cgroup/memory.max)"
33+
print_metric "cgroup v2 memory.high" "$(cat_file /sys/fs/cgroup/memory.high)"
34+
print_metric "cgroup v2 memory.current" "$(cat_file /sys/fs/cgroup/memory.current)"
35+
if [ -f /sys/fs/cgroup/memory.pressure ]; then
36+
print_metric "cgroup v2 memory.pressure" "$(cat_file /sys/fs/cgroup/memory.pressure)"
37+
fi
38+
if [ -f /sys/fs/cgroup/memory.events ]; then
39+
print_metric "cgroup v2 memory.events oom" "$( (grep -E '^oom\\s' /sys/fs/cgroup/memory.events | cut -d' ' -f2) 2>/dev/null || echo 'not found')"
40+
print_metric "cgroup v2 memory.events oom_kill" "$( (grep -E '^oom_kill\\s' /sys/fs/cgroup/memory.events | cut -d' ' -f2) 2>/dev/null || echo 'not found')"
41+
print_metric "cgroup v2 memory.events high" "$( (grep -E '^high\\s' /sys/fs/cgroup/memory.events | cut -d' ' -f2) 2>/dev/null || echo 'not found')"
42+
fi
43+
44+
# CPU metrics
45+
print_metric "cgroup v2 cpu.max" "$(cat_file /sys/fs/cgroup/cpu.max)"
46+
print_metric "cgroup v2 cpu.nr_throttled" "$( (grep -E "^nr_throttled[[:space:]]+" /sys/fs/cgroup/cpu.stat | cut -d' ' -f2) 2>/dev/null || echo 'not found')"
47+
print_metric "cgroup v2 cpu.throttled_usec" "$( (grep -E "^throttled_usec[[:space:]]+" /sys/fs/cgroup/cpu.stat | cut -d' ' -f2) 2>/dev/null || echo 'not found')"
48+
print_metric "cgroup v2 cpu.usage_usec" "$( (grep -E "^usage_usec[[:space:]]+" /sys/fs/cgroup/cpu.stat | cut -d' ' -f2) 2>/dev/null || echo 'not found')"
49+
if [ -f /sys/fs/cgroup/cpu.pressure ]; then # cpu.pressure might not exist on older kernels/setups
50+
print_metric "cgroup v2 cpu.pressure" "$(cat_file /sys/fs/cgroup/cpu.pressure)"
51+
fi
52+
53+
elif [ -d "/sys/fs/cgroup/memory" ]; then # Assuming if memory cgroup v1 exists, cpu might too
54+
# cgroup v1
55+
# Note: In cgroup v1, memory stats are typically found under /sys/fs/cgroup/memory/
56+
# The specific path might vary if inside a nested cgroup.
57+
# This script assumes it's running in a context where /sys/fs/cgroup/memory/ points to the relevant cgroup.
58+
print_metric "cgroup v1 memory.usage_in_bytes" "$(cat_file /sys/fs/cgroup/memory/memory.usage_in_bytes)"
59+
print_metric "cgroup v1 memory.limit_in_bytes" "$(cat_file /sys/fs/cgroup/memory/memory.limit_in_bytes)"
60+
print_metric "cgroup v1 memory.failcnt" "$(cat_file /sys/fs/cgroup/memory/memory.failcnt)"
61+
print_metric "cgroup v1 memory.max_usage_in_bytes" "$(cat_file /sys/fs/cgroup/memory/memory.max_usage_in_bytes)"
62+
63+
# Throttling stats from /sys/fs/cgroup/cpu/cpu.stat
64+
if [ -f /sys/fs/cgroup/cpu/cpu.stat ]; then
65+
print_metric "cgroup v1 cpu.nr_throttled" "$( (grep -E "^nr_throttled[[:space:]]+" /sys/fs/cgroup/cpu/cpu.stat | cut -d' ' -f2) 2>/dev/null || echo 'not found')"
66+
print_metric "cgroup v1 cpu.throttled_time_ns" "$( (grep -E "^throttled_time[[:space:]]+" /sys/fs/cgroup/cpu/cpu.stat | cut -d' ' -f2) 2>/dev/null || echo 'not found')"
67+
else
68+
# Print not found for these specific metrics if cpu.stat is missing, to avoid ambiguity
69+
print_metric "cgroup v1 cpu.nr_throttled" "not found (cpu.stat)"
70+
print_metric "cgroup v1 cpu.throttled_time_ns" "not found (cpu.stat)"
71+
fi
72+
# CPU Quota settings from /sys/fs/cgroup/cpu/
73+
print_metric "cgroup v1 cpu.cfs_period_us" "$(cat_file /sys/fs/cgroup/cpu/cpu.cfs_period_us)"
74+
print_metric "cgroup v1 cpu.cfs_quota_us" "$(cat_file /sys/fs/cgroup/cpu/cpu.cfs_quota_us)"
75+
# CPU usage from /sys/fs/cgroup/cpuacct/ (usually same hierarchy as cpu)
76+
print_metric "cgroup v1 cpuacct.usage_ns" "$(cat_file /sys/fs/cgroup/cpuacct/cpuacct.usage)"
77+
print_metric "cgroup v1 cpuacct.usage_user_ns" "$(cat_file /sys/fs/cgroup/cpuacct/cpuacct.usage_user)"
78+
print_metric "cgroup v1 cpuacct.usage_sys_ns" "$(cat_file /sys/fs/cgroup/cpuacct/cpuacct.usage_sys)"
79+
80+
else
81+
printf "cgroup memory paths not found. Neither cgroup v2 controller file nor cgroup v1 memory directory detected.\n"
82+
fi
83+

dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class GradleDaemonSmokeTest extends AbstractGradleTest {
5050

5151
where:
5252
gradleVersion | projectName | successExpected | expectedTraces | expectedCoverages
53-
"3.0" | "test-succeed-old-gradle" | true | 5 | 1
53+
"3.5" | "test-succeed-old-gradle" | true | 5 | 1
5454
"7.6.4" | "test-succeed-legacy-instrumentation" | true | 5 | 1
5555
"7.6.4" | "test-succeed-multi-module-legacy-instrumentation" | true | 7 | 2
5656
"7.6.4" | "test-succeed-multi-forks-legacy-instrumentation" | true | 6 | 2
@@ -244,6 +244,7 @@ class GradleDaemonSmokeTest extends AbstractGradleTest {
244244
.withProjectDir(projectFolder.toFile())
245245
.withGradleVersion(gradleVersion)
246246
.withArguments(arguments)
247+
.withEnvironment(["GRADLE_VERSION": gradleVersion])
247248
.forwardOutput()
248249

249250
println "${new Date()}: $specificationContext.currentIteration.displayName - Starting Gradle run"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[ {
22
"files" : [ {
3-
"bitmap" : "AAAAx98=",
3+
"bitmap" : "AAAAx+EN",
44
"filename" : "src/test/java/datadog/smoke/HelloPluginFunctionalTest.java"
55
} ],
66
"span_id" : ${content_span_id_4},
77
"test_session_id" : ${content_test_session_id},
88
"test_suite_id" : ${content_test_suite_id}
9-
} ]
9+
} ]

dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/events.ftl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
"_dd.profiling.enabled" : 0,
216216
"_dd.trace_span_attribute_schema" : 0,
217217
"process_id" : ${content_metrics_process_id_2},
218-
"test.source.end" : 40,
218+
"test.source.end" : 44,
219219
"test.source.start" : 16
220220
},
221221
"name" : "junit5.test_suite",
@@ -273,7 +273,7 @@
273273
"_dd.profiling.enabled" : 0,
274274
"_dd.trace_span_attribute_schema" : 0,
275275
"process_id" : ${content_metrics_process_id_2},
276-
"test.source.end" : 39,
276+
"test.source.end" : 43,
277277
"test.source.start" : 30
278278
},
279279
"name" : "junit5.test",
@@ -464,4 +464,4 @@
464464
},
465465
"type" : "span",
466466
"version" : 1
467-
} ]
467+
} ]

dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/src/test/java/datadog/smoke/HelloPluginFunctionalTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ void pluginPrintsHelloMessageOnGradle85() {
3030
BuildResult result = GradleRunner.create()
3131
.withProjectDir(testProjectDir.toFile())
3232
.withPluginClasspath()
33-
.withGradleVersion("8.5")
33+
// Use the same Gradle version as of the actual smoke test that builds this project.
34+
// This is to ensure Gradle is already downloaded and available in the environment.
35+
// Gradle Test Kit can download a Gradle distribution by itself,
36+
// but sometimes these downloads fail, making the test flaky.
37+
.withGradleVersion(System.getenv("GRADLE_VERSION"))
3438
.withArguments("hello", "--stacktrace")
3539
.forwardOutput()
3640
.build();

0 commit comments

Comments
 (0)