Skip to content

Commit c708338

Browse files
Merge branch 'master' into alexeyk/move-json-to-thread
2 parents 7dc3e05 + 6fc7077 commit c708338

File tree

520 files changed

+25254
-22852
lines changed

Some content is hidden

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

520 files changed

+25254
-22852
lines changed

.github/workflows/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ _Action:_ Build the Java Client Library and runs [the system tests](https://gith
130130

131131
_Recovery:_ Manually trigger the action on the desired branch.
132132

133+
### update-jmxfetch-submodule [🔗](update-jmxfetch-submodule.yaml)
134+
135+
_Trigger:_ Monthly or manually
136+
137+
_Action:_ Creates a PR updating the git submodule at dd-java-agent/agent-jmxfetch/integrations-core
138+
139+
_Recovery:_ Manually trigger the action again.
140+
133141
## Maintenance
134142

135143
GitHub actions should be part of the [repository allowed actions to run](https://github.com/DataDog/dd-trace-java/settings/actions).

.github/workflows/add-release-to-cloudfoundry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: |
4444
echo "${{ steps.get-release-version.outputs.VERSION }}: ${{ steps.get-release-url.outputs.URL }}" >> index.yml
4545
- name: Commit and push changes
46-
uses: planetscale/ghcommit-action@6a383e778f6620afde4bf4b45069d3c6983c1ae2 # v0.2.15
46+
uses: planetscale/ghcommit-action@7c35caed9937939812c7d4242ffab823e9b3b1fa # v0.2.16
4747
with:
4848
commit_message: "chore: Add version ${{ steps.get-release-version.outputs.VERSION }} to Cloud Foundry"
4949
repo: ${{ github.repository }}

.github/workflows/analyze-changes.yaml

Lines changed: 3 additions & 3 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@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
43+
uses: github/codeql-action/init@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
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@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
60+
uses: github/codeql-action/analyze@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
6161

6262
trivy:
6363
name: Analyze changes with 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@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
125+
uses: github/codeql-action/upload-sarif@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
126126
if: always()
127127
with:
128128
sarif_file: 'trivy-results.sarif'
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update jmxfetch integrations submodule
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 1 * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
14+
15+
- name: Update Submodule
16+
run: |
17+
git submodule update --remote -- dd-java-agent/agent-jmxfetch/integrations-core
18+
- name: Download ghcommit CLI
19+
run: |
20+
curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L
21+
chmod +x /usr/local/bin/ghcommit
22+
- name: Pick a branch name
23+
id: define-branch
24+
run: echo "branch=ci/update-jmxfetch-submodule-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
25+
- name: Create branch
26+
run: |
27+
git checkout -b ${{ steps.define-branch.outputs.branch }}
28+
git push -u origin ${{ steps.define-branch.outputs.branch }} --force
29+
- name: Commit and push changes
30+
env:
31+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
32+
run: |
33+
ghcommit --repository ${{ github.repository }} --branch ${{ steps.define-branch.outputs.branch }} --add dd-java-agent/agent-jmxfetch/integrations-core --message "Update agent-jmxfetch submodule"
34+
- name: Create pull request
35+
env:
36+
GH_TOKEN: ${{ github.token }}
37+
run: |
38+
gh pr create --title "Update agent-jmxfetch submodule" \
39+
--base master \
40+
--head ${{ steps.define-branch.outputs.branch }} \
41+
--label "comp: tooling" \
42+
--label "type: enhancement" \
43+
--label "tag: no release notes" \
44+
--body "This PR updates the agent-jmxfetch submodule."

.gitlab-ci.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ default:
141141
CACHE_COMPRESSION_LEVEL: "slowest"
142142

143143
RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE: 4 # Runtime.getRuntime().availableProcessors() returns incorrect or very high values in Kubernetes
144+
GIT_SUBMODULE_STRATEGY: normal
145+
GIT_SUBMODULE_DEPTH: 1
144146
cache:
145147
- key: dependency-$CACHE_TYPE # Dependencies cache
146148
paths:
@@ -191,6 +193,7 @@ default:
191193
after_script:
192194
- *cgroup_info
193195

196+
# TODO: Add a pre-release check to see if the dd-octo-sts token is working.
194197
# Checks and fail early if central credentials are incorrect, indeed, when a new token is generated
195198
# on the central publisher protal, it invalidates the old one. This checks prevents going further.
196199
# See https://datadoghq.atlassian.net/wiki/x/Oog5OgE
@@ -802,14 +805,54 @@ deploy_to_maven_central:
802805

803806
deploy_artifacts_to_github:
804807
stage: publish
805-
image: registry.ddbuild.io/github-cli:v27480869-eafb11d-2.43.0
808+
image: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.06-1
809+
tags: [ "arch:amd64" ]
810+
id_tokens:
811+
DDOCTOSTS_ID_TOKEN:
812+
aud: dd-octo-sts
806813
rules:
807814
- if: '$POPULATE_CACHE'
808815
when: never
809816
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
810817
when: on_success
811818
# Requires the deploy_to_maven_central job to have run first (the UP-TO-DATE gradle check across jobs is broken)
812819
# This will deploy the artifacts built from the publishToSonatype task to the GitHub release
820+
needs:
821+
- job: deploy_to_maven_central
822+
# The deploy_to_maven_central job is not run for release candidate versions
823+
optional: true
824+
before_script:
825+
# Get token
826+
- dd-octo-sts version
827+
- dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.release
828+
- dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.release > github-token.txt
829+
script:
830+
- gh auth login --with-token < github-token.txt
831+
- gh auth status # Maybe helpful to have this output in logs?
832+
- export VERSION=${CI_COMMIT_TAG##v} # remove "v" from front of tag to get version
833+
- cp workspace/dd-java-agent/build/libs/dd-java-agent-${VERSION}.jar workspace/dd-java-agent/build/libs/dd-java-agent.jar # we upload two filenames
834+
- gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-java-agent/build/libs/dd-java-agent.jar
835+
- gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-java-agent/build/libs/dd-java-agent-${VERSION}.jar
836+
- gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-trace-api/build/libs/dd-trace-api-${VERSION}.jar
837+
- gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-trace-ot/build/libs/dd-trace-ot-${VERSION}.jar
838+
after_script:
839+
- dd-octo-sts revoke -t $(cat github-token.txt)
840+
retry:
841+
max: 2
842+
when: always
843+
844+
# This is the original job that uses the AWS SSM token retrieval method. Allow manual triggering in case the dd-octo-sts token is not working.
845+
# TODO: Remove this job once the dd-octo-sts token is provably working.
846+
deploy_artifacts_to_github_old:
847+
stage: publish
848+
image: registry.ddbuild.io/github-cli:v27480869-eafb11d-2.43.0
849+
rules:
850+
- if: '$POPULATE_CACHE'
851+
when: never
852+
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
853+
when: manual
854+
# Requires the deploy_to_maven_central job to have run first (the UP-TO-DATE gradle check across jobs is broken)
855+
# This will deploy the artifacts built from the publishToSonatype task to the GitHub release
813856
needs:
814857
- job: deploy_to_maven_central
815858
# The deploy_to_maven_central job is not run for release candidate versions
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Thresholds set based on guidance in https://datadoghq.atlassian.net/wiki/x/LgI1LgE#How-to-choose-thresholds-for-pre-release-gates%3F
2+
3+
experiments:
4+
- name: Run SLO breach check
5+
steps:
6+
- name: SLO breach check
7+
run: fail_on_breach
8+
# https://datadoghq.atlassian.net/wiki/x/LgI1LgE#How-to-choose-a-warning-range-for-pre-release-gates%3F
9+
warning_range: 10
10+
# File spec
11+
# https://datadoghq.atlassian.net/wiki/x/LgI1LgE#Specification
12+
# Measurements
13+
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario
14+
scenarios:
15+
# Note that thresholds there are choosen based the confidence interval with a 10% adjustment.
16+
17+
# Standard macrobenchmarks
18+
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=normal_operation%2Fonly-tracing&trendsType=scenario
19+
- name: normal_operation/only-tracing
20+
thresholds:
21+
- agg_http_req_duration_p50 < 2.6 ms
22+
- agg_http_req_duration_p99 < 8.5 ms
23+
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=normal_operation%2Fotel-latest&trendsType=scenario
24+
- name: normal_operation/otel-latest
25+
thresholds:
26+
- agg_http_req_duration_p50 < 2.5 ms
27+
- agg_http_req_duration_p99 < 10 ms
28+
29+
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=high_load%2Fonly-tracing&trendsType=scenario
30+
- name: high_load/only-tracing
31+
thresholds:
32+
- throughput > 1100.0 op/s
33+
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=high_load%2Fotel-latest&trendsType=scenario
34+
- name: high_load/otel-latest
35+
thresholds:
36+
- throughput > 1100.0 op/s
37+
38+
# Startup macrobenchmarks
39+
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=startup%3Apetclinic%3Atracing%3AGlobalTracer&trendsType=scenario
40+
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=startup%3Apetclinic%3Aappsec%3AGlobalTracer&trendsType=scenario
41+
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=startup%3Apetclinic%3Aiast%3AGlobalTracer&trendsType=scenario
42+
- name: "startup:petclinic:(tracing|appsec|iast):GlobalTracer"
43+
thresholds:
44+
- execution_time < 280 ms
45+
# https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=startup%3Apetclinic%3Aprofiling%3AGlobalTracer&trendsType=scenario
46+
- name: "startup:petclinic:profiling:GlobalTracer"
47+
thresholds:
48+
- execution_time < 420 ms

.gitlab/macrobenchmarks.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
include:
2+
project: 'DataDog/benchmarking-platform-tools'
3+
file: 'images/templates/gitlab/notify-slo-breaches.template.yml'
4+
ref: '925e0a3e7dd628885f6fc69cdaea5c8cc9e212bc'
5+
16
.macrobenchmarks:
27
stage: macrobenchmarks
38
rules:
@@ -68,3 +73,66 @@ otel-latest:
6873
BP_BENCHMARKS_CONFIGURATION: otel-latest
6974
TRACER_OPTS: -javaagent:/app/otel-java-agent.jar -Ddd.env=otel-latest -Ddd.service=bp-java-petclinic
7075
JAVA_OPTS: -javaagent:/app/memcheck/stability-testing-memwatch.jar -Xmx128M
76+
77+
78+
check-slo-breaches:
79+
stage: macrobenchmarks
80+
interruptible: true
81+
tags: ["arch:amd64"]
82+
image: registry.ddbuild.io/images/benchmarking-platform-tools-ubuntu:latest
83+
when: on_success
84+
needs:
85+
- job: baseline
86+
artifacts: true
87+
- job: only-tracing
88+
artifacts: true
89+
- job: otel-latest
90+
artifacts: true
91+
- job: benchmarks-startup
92+
artifacts: true
93+
- job: benchmarks-load
94+
artifacts: true
95+
- job: benchmarks-dacapo
96+
artifacts: true
97+
script:
98+
# macrobenchmarks are located here, files are already in "converted" format
99+
- export ARTIFACTS_DIR="$(pwd)/platform/artifacts/" && mkdir -p "${ARTIFACTS_DIR}"
100+
101+
# Need to move the artifacts the benchmarks-* job
102+
- |
103+
export BENCHMARKS_ARTIFACTS_DIR="$(pwd)/reports" && mkdir -p "${BENCHMARKS_ARTIFACTS_DIR}"
104+
for benchmarkType in startup load dacapo; do
105+
find "$BENCHMARKS_ARTIFACTS_DIR/$benchmarkType" -name "benchmark-baseline.json" -o -name "benchmark-candidate.json" | while read file; do
106+
relpath="${file#$BENCHMARKS_ARTIFACTS_DIR/$benchmarkType/}"
107+
prefix="${relpath%/benchmark-*}" # Remove the trailing /benchmark-(baseline|candidate).json
108+
prefix="${prefix#./}" # Remove any leading ./
109+
prefix="${prefix//\//-}" # Replace / with -
110+
case "$file" in
111+
*benchmark-baseline.json) type="baseline" ;;
112+
*benchmark-candidate.json) type="candidate" ;;
113+
esac
114+
echo "Moving $file to $ARTIFACTS_DIR/${type}-${benchmarkType}-${prefix}.converted.json"
115+
cp "$file" "$ARTIFACTS_DIR/${type}-${benchmarkType}-${prefix}.converted.json"
116+
done
117+
done
118+
- ls -lah "$ARTIFACTS_DIR"
119+
- bp-runner .gitlab/benchmarks/bp-runner.fail-on-breach.yml
120+
artifacts:
121+
name: "artifacts"
122+
when: always
123+
paths:
124+
- platform/artifacts/
125+
expire_in: 1 week
126+
variables:
127+
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID # The ID of the current project. This ID is unique across all projects on the GitLab instance.
128+
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME # "dd-trace-java"
129+
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built.
130+
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA # The commit revision the project is built for.
131+
132+
notify-slo-breaches:
133+
extends: .notify-slo-breaches
134+
stage: macrobenchmarks
135+
needs: ["check-slo-breaches"]
136+
when: always
137+
variables:
138+
CHANNEL: "apm-release-platform"

build.gradle

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
buildscript {
2-
dependencies {
3-
classpath "pl.allegro.tech.build:axion-release-plugin:1.14.4"
4-
}
5-
6-
configurations.all {
7-
resolutionStrategy.dependencySubstitution {
8-
substitute module("com.jcraft:jsch") using module("com.github.mwiede:jsch:0.2.17") because "jcraft is unmaintained"
9-
substitute module("com.jcraft:jsch.agentproxy") using module("com.github.mwiede:jsch:0.2.17") because "jcraft is unmaintained"
10-
substitute module("com.jcraft:jzlib") using module("com.github.mwiede:jsch:0.2.17") because "jcraft is unmaintained"
11-
}
12-
}
13-
}
14-
151
plugins {
162
id 'datadog.gradle-debug'
173
id 'datadog.dependency-locking'
@@ -20,7 +6,7 @@ plugins {
206
id 'com.github.spotbugs' version '5.0.14'
217
id 'de.thetaphi.forbiddenapis' version '3.8'
228

23-
id 'pl.allegro.tech.build.axion-release' version '1.14.4'
9+
id 'org.shipkit.shipkit-auto-version' version '2.1.2'
2410
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
2511

2612
id 'com.gradleup.shadow' version '8.3.6' apply false
@@ -34,7 +20,6 @@ description = 'dd-trace-java'
3420
def isCI = System.getenv("CI") != null
3521

3622
apply from: "$rootDir/gradle/repositories.gradle"
37-
apply from: "$rootDir/gradle/scm.gradle"
3823

3924
spotless {
4025
// only resolve the spotless dependencies once in the build
@@ -69,9 +54,11 @@ apply from: "$rootDir/gradle/spotless.gradle"
6954

7055
def compileTask = tasks.register("compile")
7156

57+
def repoVersion = version
58+
7259
allprojects {
7360
group = 'com.datadoghq'
74-
version = scmVersion.version
61+
version = repoVersion
7562

7663
if (isCI) {
7764
buildDir = "$rootDir/workspace/${projectDir.path.replace(rootDir.path, '')}/build/"
@@ -119,7 +106,7 @@ nexusPublishing {
119106

120107
def writeMainVersionFileTask = tasks.register('writeMainVersionFile') {
121108
def versionFile = file("${rootProject.buildDir}/main.version")
122-
inputs.property "version", scmVersion.version
109+
inputs.property "version", project.version
123110
outputs.file versionFile
124111

125112
doFirst {

0 commit comments

Comments
 (0)