Skip to content

Commit a61b090

Browse files
authored
Merge branch 'master' into zarir/ssr-aws-sdk
2 parents 2cd9ad0 + ae34f27 commit a61b090

File tree

659 files changed

+27648
-24839
lines changed

Some content is hidden

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

659 files changed

+27648
-24839
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
issuer: https://gitlab.ddbuild.io
2+
3+
subject_pattern: "project_path:DataDog/apm-reliability/dd-trace-java:ref_type:tag:ref:v.*"
4+
5+
claim_pattern:
6+
project_path: "DataDog/apm-reliability/dd-trace-java"
7+
ref_type: "tag"
8+
ref: "v.*"
9+
10+
permissions:
11+
contents: "write"

.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-milestone-to-pull-requests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
- name: Add milestone to merged pull requests
1818
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # 7.0.1
1919
with:
20+
retries: 3
21+
retry-exempt-status-codes: 400,401
2022
script: |
2123
// Get project milestones
2224
const response = await github.rest.issues.listMilestones({

.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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ 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'
4747

4848
- name: Build dd-trace-java for creating the CodeQL database
4949
run: |
50-
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
50+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
5151
JAVA_HOME=$JAVA_HOME_8_X64 \
5252
JAVA_8_HOME=$JAVA_HOME_8_X64 \
5353
JAVA_11_HOME=$JAVA_HOME_11_X64 \
@@ -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
@@ -93,7 +93,7 @@ jobs:
9393
9494
- name: Build and publish artifacts locally
9595
run: |
96-
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
96+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
9797
JAVA_HOME=$JAVA_HOME_8_X64 \
9898
JAVA_8_HOME=$JAVA_HOME_8_X64 \
9999
JAVA_11_HOME=$JAVA_HOME_11_X64 \
@@ -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'

.github/workflows/update-gradle-dependencies.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
git push -u origin $BRANCH_NAME --force
2929
- name: Update Gradle dependencies
3030
run: |
31-
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G'" \
31+
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx3G -Xms2G'" \
3232
JAVA_HOME=$JAVA_HOME_8_X64 \
3333
JAVA_8_HOME=$JAVA_HOME_8_X64 \
3434
JAVA_11_HOME=$JAVA_HOME_11_X64 \
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: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ workflow:
6868
- "ibm8"
6969
- "zulu11"
7070
- "semeru17"
71+
CI_SPLIT: ["1/1"]
7172

7273
# Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
7374
# These blocks emulate "parallel" by including it in the matrix
@@ -141,6 +142,8 @@ default:
141142
CACHE_COMPRESSION_LEVEL: "slowest"
142143

143144
RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE: 4 # Runtime.getRuntime().availableProcessors() returns incorrect or very high values in Kubernetes
145+
GIT_SUBMODULE_STRATEGY: normal
146+
GIT_SUBMODULE_DEPTH: 1
144147
cache:
145148
- key: dependency-$CACHE_TYPE # Dependencies cache
146149
paths:
@@ -191,10 +194,10 @@ default:
191194
after_script:
192195
- *cgroup_info
193196

194-
# Checks and fail early if central credentials are incorrect, indeed, when a new token is generated
195-
# on the central publisher protal, it invalidates the old one. This checks prevents going further.
197+
# Check and fail early if maven central credentials are incorrect. When a new token is generated
198+
# on the central publisher portal, it invalidates the old one. This check prevents going further.
196199
# See https://datadoghq.atlassian.net/wiki/x/Oog5OgE
197-
pre-release-checks:
200+
maven-central-pre-release-check:
198201
image: ghcr.io/datadog/dd-trace-java-docker-build:${BUILDER_IMAGE_VERSION_PREFIX}base
199202
stage: .pre
200203
rules:
@@ -213,9 +216,37 @@ pre-release-checks:
213216
exit 1
214217
fi
215218
219+
dd-octo-sts-pre-release-check:
220+
image: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.06-1
221+
stage: .pre
222+
tags: [ "arch:amd64" ]
223+
id_tokens:
224+
DDOCTOSTS_ID_TOKEN:
225+
aud: dd-octo-sts
226+
rules:
227+
- if: '$POPULATE_CACHE'
228+
when: never
229+
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
230+
when: on_success
231+
allow_failure: false
232+
before_script:
233+
- dd-octo-sts version
234+
- dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.release
235+
- dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.release > test-github-token.txt
236+
script:
237+
- gh auth login --with-token < test-github-token.txt
238+
- gh auth status
239+
after_script:
240+
- dd-octo-sts revoke -t $(cat test-github-token.txt)
241+
retry:
242+
max: 2
243+
when: always
244+
216245
build:
217246
needs:
218-
- job: pre-release-checks
247+
- job: maven-central-pre-release-check
248+
optional: true
249+
- job: dd-octo-sts-pre-release-check
219250
optional: true
220251
extends: .gradle_build
221252
variables:
@@ -802,7 +833,11 @@ deploy_to_maven_central:
802833

803834
deploy_artifacts_to_github:
804835
stage: publish
805-
image: registry.ddbuild.io/github-cli:v27480869-eafb11d-2.43.0
836+
image: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.06-1
837+
tags: [ "arch:amd64" ]
838+
id_tokens:
839+
DDOCTOSTS_ID_TOKEN:
840+
aud: dd-octo-sts
806841
rules:
807842
- if: '$POPULATE_CACHE'
808843
when: never
@@ -814,16 +849,21 @@ deploy_artifacts_to_github:
814849
- job: deploy_to_maven_central
815850
# The deploy_to_maven_central job is not run for release candidate versions
816851
optional: true
852+
before_script:
853+
- dd-octo-sts version
854+
- dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.release
855+
- dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.release > github-token.txt
817856
script:
818-
- aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.gh_release_token --with-decryption --query "Parameter.Value" --out text > github-token.txt
819857
- gh auth login --with-token < github-token.txt
820-
- gh auth status # Maybe helpful to have this output in logs?
858+
- gh auth status
821859
- export VERSION=${CI_COMMIT_TAG##v} # remove "v" from front of tag to get version
822-
- 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
860+
- cp workspace/dd-java-agent/build/libs/dd-java-agent-${VERSION}.jar workspace/dd-java-agent/build/libs/dd-java-agent.jar # upload two filenames
823861
- gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-java-agent/build/libs/dd-java-agent.jar
824862
- gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-java-agent/build/libs/dd-java-agent-${VERSION}.jar
825863
- gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-trace-api/build/libs/dd-trace-api-${VERSION}.jar
826864
- gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-trace-ot/build/libs/dd-trace-ot-${VERSION}.jar
865+
after_script:
866+
- dd-octo-sts revoke -t $(cat github-token.txt)
827867
retry:
828868
max: 2
829869
when: always
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: 71 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,69 @@ 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+
rules:
84+
- if: $POPULATE_CACHE
85+
when: never
86+
- when: on_success
87+
needs:
88+
- job: baseline
89+
artifacts: true
90+
- job: only-tracing
91+
artifacts: true
92+
- job: otel-latest
93+
artifacts: true
94+
- job: benchmarks-startup
95+
artifacts: true
96+
- job: benchmarks-load
97+
artifacts: true
98+
- job: benchmarks-dacapo
99+
artifacts: true
100+
script:
101+
# macrobenchmarks are located here, files are already in "converted" format
102+
- export ARTIFACTS_DIR="$(pwd)/platform/artifacts/" && mkdir -p "${ARTIFACTS_DIR}"
103+
104+
# Need to move the artifacts the benchmarks-* job
105+
- |
106+
export BENCHMARKS_ARTIFACTS_DIR="$(pwd)/reports" && mkdir -p "${BENCHMARKS_ARTIFACTS_DIR}"
107+
for benchmarkType in startup load dacapo; do
108+
find "$BENCHMARKS_ARTIFACTS_DIR/$benchmarkType" -name "benchmark-baseline.json" -o -name "benchmark-candidate.json" | while read file; do
109+
relpath="${file#$BENCHMARKS_ARTIFACTS_DIR/$benchmarkType/}"
110+
prefix="${relpath%/benchmark-*}" # Remove the trailing /benchmark-(baseline|candidate).json
111+
prefix="${prefix#./}" # Remove any leading ./
112+
prefix="${prefix//\//-}" # Replace / with -
113+
case "$file" in
114+
*benchmark-baseline.json) type="baseline" ;;
115+
*benchmark-candidate.json) type="candidate" ;;
116+
esac
117+
echo "Moving $file to $ARTIFACTS_DIR/${type}-${benchmarkType}-${prefix}.converted.json"
118+
cp "$file" "$ARTIFACTS_DIR/${type}-${benchmarkType}-${prefix}.converted.json"
119+
done
120+
done
121+
- ls -lah "$ARTIFACTS_DIR"
122+
- bp-runner .gitlab/benchmarks/bp-runner.fail-on-breach.yml
123+
artifacts:
124+
name: "artifacts"
125+
when: always
126+
paths:
127+
- platform/artifacts/
128+
expire_in: 1 week
129+
variables:
130+
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID # The ID of the current project. This ID is unique across all projects on the GitLab instance.
131+
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME # "dd-trace-java"
132+
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built.
133+
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA # The commit revision the project is built for.
134+
135+
notify-slo-breaches:
136+
extends: .notify-slo-breaches
137+
stage: macrobenchmarks
138+
needs: ["check-slo-breaches"]
139+
when: always
140+
variables:
141+
CHANNEL: "apm-release-platform"

0 commit comments

Comments
 (0)