Skip to content

Commit 009849d

Browse files
committed
Merge branch 'master' into sarahchen6/move-macrobenchmarks
2 parents 1b6bc24 + a3af52f commit 009849d

File tree

629 files changed

+10739
-25512
lines changed

Some content is hidden

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

629 files changed

+10739
-25512
lines changed

.github/chainguard/self.pin-system-tests.create-pr.sts.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
issuer: https://token.actions.githubusercontent.com
22

3-
subject_pattern: repo:DataDog/dd-trace-java:ref:refs/heads/(master|test/v.+)
3+
subject_pattern: repo:DataDog/dd-trace-java:ref:refs/heads/(master|release/v.+)
44

55
claim_pattern:
66
event_name: (create|workflow_dispatch)
7-
ref: refs/heads/(master|test/v.+)
8-
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/pin-system-tests\.yaml@refs/heads/(master|test/v.+)
7+
ref: refs/heads/(master|release/v.+)
8+
job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/pin-system-tests\.yaml@refs/heads/(master|release/v.+)
99

1010
permissions:
1111
contents: write

.github/workflows/pin-system-tests.yaml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ on:
1313
jobs:
1414
pin-system-tests:
1515
name: "Pin system tests"
16-
# CHANGE BACK TO release/v*
17-
if: github.event_name != 'create' || startsWith(github.ref, 'refs/heads/test/v')
16+
if: github.event_name != 'create' || startsWith(github.ref, 'refs/heads/release/v')
1817
runs-on: ubuntu-latest
1918
permissions:
20-
contents: write # may not be needed
21-
id-token: write # Required for OIDC token federation
19+
contents: write
20+
id-token: write # required for OIDC token federation
2221
steps:
2322
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
2423
id: octo-sts
@@ -55,11 +54,10 @@ jobs:
5554
run: |
5655
BRANCH=${{ steps.define-branch.outputs.branch }}
5756
if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
58-
echo "creating_new_branch=false" >> "$GITHUB_OUTPUT"
59-
echo "Branch $BRANCH already exists - please delete it and re-run the workflow."
57+
echo "ERROR: Branch $BRANCH already exists - please delete it and re-run the workflow."
58+
exit 1
6059
else
61-
echo "creating_new_branch=true" >> "$GITHUB_OUTPUT"
62-
echo "Branch $BRANCH does not exist - creating it now"
60+
echo "Branch $BRANCH does not exist - creating it now."
6361
fi
6462
6563
- name: Update system-tests references to latest commit SHA on main
@@ -69,16 +67,14 @@ jobs:
6967
id: check-changes
7068
run: |
7169
if [[ -z "$(git status -s)" ]]; then
72-
echo "No changes to commit, exiting."
73-
echo "commit_changes=false" >> "$GITHUB_OUTPUT"
70+
echo "ERROR: No changes to commit - the system-tests reference was not updated."
71+
exit 1
7472
else
75-
echo "commit_changes=true" >> "$GITHUB_OUTPUT"
7673
echo "Changes to commit:"
7774
git status -s
7875
fi
7976
8077
- name: Commit changes
81-
if: steps.check-changes.outputs.commit_changes == 'true'
8278
id: create-commit
8379
run: |
8480
git config user.name "github-actions[bot]"
@@ -88,7 +84,6 @@ jobs:
8884
8985
- name: Push changes
9086
uses: DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
91-
if: steps.check-changes.outputs.commit_changes == 'true' && steps.check-branch.outputs.creating_new_branch == 'true'
9287
with:
9388
token: "${{ steps.octo-sts.outputs.token }}"
9489
branch: "${{ steps.define-branch.outputs.branch }}"
@@ -98,15 +93,12 @@ jobs:
9893
commits: "${{ steps.create-commit.outputs.commit }}"
9994

10095
- name: Create pull request
101-
if: steps.check-changes.outputs.commit_changes == 'true' && steps.check-branch.outputs.creating_new_branch == 'true'
10296
env:
10397
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
104-
# REMOVE DRAFT
10598
run: |
10699
gh pr create --title "Pin system tests for release branch" \
107100
--base ${{ steps.define-base-branch.outputs.base_branch }} \
108101
--head ${{ steps.define-branch.outputs.branch }} \
109102
--label "tag: dependencies" \
110103
--label "tag: no release notes" \
111104
--body "This PR pins the system-tests reference for the release branch." \
112-
--draft

.gitlab-ci.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,7 @@ default:
112112
.normalize_node_index: &normalize_node_index
113113
- if [ "$CI_NO_SPLIT" == "true" ] ; then CI_NODE_INDEX=1; CI_NODE_TOTAL=1; fi # A job uses parallel but doesn't intend to split by index
114114
- if [ -n "$CI_SPLIT" ]; then CI_NODE_INDEX="${CI_SPLIT%%/*}"; CI_NODE_TOTAL="${CI_SPLIT##*/}"; fi
115-
- echo "CI_NODE_TOTAL=${CI_NODE_TOTAL}, CI_NODE_INDEX=$CI_NODE_INDEX"
116-
- export NORMALIZED_NODE_TOTAL=${CI_NODE_TOTAL:-1}
117-
- ONE_INDEXED_NODE_INDEX=${CI_NODE_INDEX:-1}; export NORMALIZED_NODE_INDEX=$((ONE_INDEXED_NODE_INDEX - 1))
118-
- echo "NORMALIZED_NODE_TOTAL=${NORMALIZED_NODE_TOTAL}, NORMALIZED_NODE_INDEX=$NORMALIZED_NODE_INDEX"
115+
- echo "CI_NODE_INDEX=$CI_NODE_INDEX, CI_NODE_TOTAL=${CI_NODE_TOTAL}"
119116

120117
.cgroup_info: &cgroup_info
121118
- source .gitlab/gitlab-utils.sh
@@ -423,7 +420,7 @@ test_published_artifacts:
423420
script:
424421
- *gitlab_base_ref_params
425422
- ./gradlew --version
426-
- ./gradlew $GRADLE_TARGET $GRADLE_PARAMS -PskipTests -PrunBuildSrcTests -PskipSpotless -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS
423+
- ./gradlew $GRADLE_TARGET -x spotlessCheck $GRADLE_PARAMS -PskipTests -PrunBuildSrcTests -Pslot=$CI_NODE_INDEX/$CI_NODE_TOTAL $GRADLE_ARGS
427424
after_script:
428425
- *cgroup_info
429426
- source .gitlab/gitlab-utils.sh
@@ -491,7 +488,7 @@ muzzle:
491488
script:
492489
- export SKIP_BUILDSCAN="true"
493490
- ./gradlew --version
494-
- ./gradlew :runMuzzle -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS
491+
- ./gradlew :runMuzzle -Pslot=$CI_NODE_INDEX/$CI_NODE_TOTAL $GRADLE_ARGS
495492
after_script:
496493
- *cgroup_info
497494
- source .gitlab/gitlab-utils.sh
@@ -573,7 +570,7 @@ muzzle-dep-report:
573570
- *prepare_test_env
574571
- export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms$GRADLE_MEM -Xmx$GRADLE_MEM $PROFILER_COMMAND -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp' -Ddatadog.forkedMaxHeapSize=1024M -Ddatadog.forkedMinHeapSize=128M"
575572
- ./gradlew --version
576-
- ./gradlew $GRADLE_TARGET $GRADLE_PARAMS -PtestJvm=$testJvm -PtaskPartitionCount=$NORMALIZED_NODE_TOTAL -PtaskPartition=$NORMALIZED_NODE_INDEX $GRADLE_ARGS --continue || $CONTINUE_ON_FAILURE
573+
- ./gradlew $GRADLE_TARGET $GRADLE_PARAMS -PtestJvm=$testJvm -Pslot=$CI_NODE_INDEX/$CI_NODE_TOTAL $GRADLE_ARGS --continue || $CONTINUE_ON_FAILURE
577574
after_script:
578575
- *restore_pretest_env
579576
- *set_datadog_api_keys

.gitlab/macrobenchmarks.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
include:
2+
- project: 'DataDog/benchmarking-platform-tools'
3+
file: 'images/templates/gitlab/notify-slo-breaches.template.yml'
4+
- project: 'DataDog/benchmarking-platform-tools'
5+
file: 'images/templates/gitlab/check-slo-breaches.template.yml'
6+
7+
.macrobenchmarks:
8+
stage: macrobenchmarks
9+
rules:
10+
- if: $POPULATE_CACHE
11+
when: never
12+
- if: ($NIGHTLY_BENCHMARKS || $CI_PIPELINE_SOURCE != "schedule") && $CI_COMMIT_REF_NAME == "master"
13+
when: always
14+
interruptible: false
15+
- when: manual
16+
interruptible: true
17+
allow_failure: true
18+
tags: ["runner:apm-k8s-same-cpu"]
19+
needs: ["build"]
20+
timeout: 1h
21+
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-java-petclinic
22+
script:
23+
- git clone --branch java/petclinic https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform && cd platform
24+
- ./steps/run-benchmarks.sh
25+
artifacts:
26+
name: "artifacts"
27+
when: always
28+
paths:
29+
- platform/artifacts/
30+
expire_in: 3 months
31+
variables:
32+
K6_OPTIONS_WARMUP_RATE: 2000
33+
K6_OPTIONS_WARMUP_DURATION: 5m
34+
K6_OPTIONS_WARMUP_GRACEFUL_STOP: 10s
35+
K6_OPTIONS_WARMUP_PRE_ALLOCATED_VUS: 4
36+
K6_OPTIONS_WARMUP_MAX_VUS: 4
37+
38+
K6_OPTIONS_NORMAL_OPERATION_RATE: 1500
39+
K6_OPTIONS_NORMAL_OPERATION_DURATION: 10m
40+
K6_OPTIONS_NORMAL_OPERATION_GRACEFUL_STOP: 10s
41+
K6_OPTIONS_NORMAL_OPERATION_PRE_ALLOCATED_VUS: 4
42+
K6_OPTIONS_NORMAL_OPERATION_MAX_VUS: 4
43+
44+
K6_OPTIONS_HIGH_LOAD_RATE: 4000
45+
K6_OPTIONS_HIGH_LOAD_DURATION: 5m
46+
K6_OPTIONS_HIGH_LOAD_GRACEFUL_STOP: 10s
47+
K6_OPTIONS_HIGH_LOAD_PRE_ALLOCATED_VUS: 4
48+
K6_OPTIONS_HIGH_LOAD_MAX_VUS: 4
49+
retry:
50+
max: 2
51+
when:
52+
- unknown_failure
53+
- data_integrity_failure
54+
- runner_system_failure
55+
- scheduler_failure
56+
- api_failure
57+
58+
baseline:
59+
extends: .macrobenchmarks
60+
variables:
61+
BP_BENCHMARKS_CONFIGURATION: baseline
62+
TRACER_OPTS: -Ddd.service=bp-java-petclinic
63+
JAVA_OPTS: -javaagent:/app/memcheck/stability-testing-memwatch.jar -Xmx128M
64+
65+
only-tracing:
66+
extends: .macrobenchmarks
67+
variables:
68+
BP_BENCHMARKS_CONFIGURATION: only-tracing
69+
TRACER_OPTS: -javaagent:/app/dd-java-agent.jar -Ddd.env=${BP_BENCHMARKS_CONFIGURATION} -Ddd.service=bp-java-petclinic
70+
JAVA_OPTS: -javaagent:/app/memcheck/stability-testing-memwatch.jar -Xmx128M
71+
72+
otel-latest:
73+
extends: .macrobenchmarks
74+
variables:
75+
BP_BENCHMARKS_CONFIGURATION: otel-latest
76+
TRACER_OPTS: -javaagent:/app/otel-java-agent.jar -Ddd.env=otel-latest -Ddd.service=bp-java-petclinic
77+
JAVA_OPTS: -javaagent:/app/memcheck/stability-testing-memwatch.jar -Xmx128M
78+
79+
80+
check-slo-breaches:
81+
extends: .check-slo-breaches
82+
stage: macrobenchmarks
83+
interruptible: true
84+
rules:
85+
- if: $POPULATE_CACHE
86+
when: never
87+
- when: on_success
88+
needs:
89+
- job: baseline
90+
artifacts: true
91+
- job: only-tracing
92+
artifacts: true
93+
- job: otel-latest
94+
artifacts: true
95+
- job: benchmarks-startup
96+
artifacts: true
97+
- job: benchmarks-load
98+
artifacts: true
99+
- job: benchmarks-dacapo
100+
artifacts: true
101+
script:
102+
# macrobenchmarks are located here, files are already in "converted" format
103+
- export ARTIFACTS_DIR="$(pwd)/platform/artifacts/" && mkdir -p "${ARTIFACTS_DIR}"
104+
105+
# Need to move the artifacts the benchmarks-* job
106+
- |
107+
export BENCHMARKS_ARTIFACTS_DIR="$(pwd)/reports" && mkdir -p "${BENCHMARKS_ARTIFACTS_DIR}"
108+
for benchmarkType in startup load dacapo; do
109+
find "$BENCHMARKS_ARTIFACTS_DIR/$benchmarkType" -name "benchmark-baseline.json" -o -name "benchmark-candidate.json" | while read file; do
110+
relpath="${file#$BENCHMARKS_ARTIFACTS_DIR/$benchmarkType/}"
111+
prefix="${relpath%/benchmark-*}" # Remove the trailing /benchmark-(baseline|candidate).json
112+
prefix="${prefix#./}" # Remove any leading ./
113+
prefix="${prefix//\//-}" # Replace / with -
114+
case "$file" in
115+
*benchmark-baseline.json) type="baseline" ;;
116+
*benchmark-candidate.json) type="candidate" ;;
117+
esac
118+
echo "Moving $file to $ARTIFACTS_DIR/${type}-${benchmarkType}-${prefix}.converted.json"
119+
cp "$file" "$ARTIFACTS_DIR/${type}-${benchmarkType}-${prefix}.converted.json"
120+
done
121+
done
122+
- ls -lah "$ARTIFACTS_DIR"
123+
- bp-runner .gitlab/benchmarks/bp-runner.fail-on-breach.yml
124+
artifacts:
125+
name: "artifacts"
126+
when: always
127+
paths:
128+
- platform/artifacts/
129+
expire_in: 1 week
130+
variables:
131+
DDOCTOSTS_POLICY: "self.gitlab.github-access.read"
132+
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID # The ID of the current project. This ID is unique across all projects on the GitLab instance.
133+
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME # "dd-trace-java"
134+
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built.
135+
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA # The commit revision the project is built for.
136+
137+
notify-slo-breaches:
138+
extends: .notify-slo-breaches
139+
stage: macrobenchmarks
140+
needs: ["check-slo-breaches"]
141+
rules:
142+
- if: $POPULATE_CACHE
143+
when: never
144+
- when: always
145+
variables:
146+
CHANNEL: "apm-java-ops-bot"

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import com.diffplug.gradle.spotless.SpotlessExtension
22
import datadog.gradle.plugin.ci.testAggregate
33

44
plugins {
5+
kotlin("jvm") version libs.versions.kotlin.plugin apply false
6+
57
id("dd-trace-java.gradle-debug")
68
id("dd-trace-java.dependency-locking")
79
id("dd-trace-java.tracer-version")
@@ -16,7 +18,6 @@ plugins {
1618
id("com.gradleup.shadow") version "8.3.6" apply false
1719
id("me.champeau.jmh") version "0.7.3" apply false
1820
id("org.gradle.playframework") version "0.13" apply false
19-
kotlin("jvm") version libs.versions.kotlin.plugin apply false
2021
}
2122

2223
description = "dd-trace-java"

buildSrc/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ gradlePlugin {
1818
id = "dd-trace-java.instrument"
1919
implementationClass = "InstrumentPlugin"
2020
}
21+
2122
create("muzzle-plugin") {
2223
id = "dd-trace-java.muzzle"
2324
implementationClass = "datadog.gradle.plugin.muzzle.MuzzlePlugin"
@@ -26,18 +27,22 @@ gradlePlugin {
2627
id = "dd-trace-java.call-site-instrumentation"
2728
implementationClass = "datadog.gradle.plugin.csi.CallSiteInstrumentationPlugin"
2829
}
30+
2931
create("tracer-version-plugin") {
3032
id = "dd-trace-java.tracer-version"
3133
implementationClass = "datadog.gradle.plugin.version.TracerVersionPlugin"
3234
}
35+
3336
create("dump-hanged-test-plugin") {
3437
id = "dd-trace-java.dump-hanged-test"
3538
implementationClass = "datadog.gradle.plugin.dump.DumpHangedTestPlugin"
3639
}
40+
3741
create("supported-config-generation") {
3842
id = "dd-trace-java.supported-config-generator"
3943
implementationClass = "datadog.gradle.plugin.config.SupportedConfigPlugin"
4044
}
45+
4146
create("supported-config-linter") {
4247
id = "dd-trace-java.config-inversion-linter"
4348
implementationClass = "datadog.gradle.plugin.config.ConfigInversionLinter"

buildSrc/call-site-instrumentation-plugin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ dependencies {
3131
implementation("org.freemarker", "freemarker", "2.3.30")
3232
implementation(libs.asm)
3333
implementation(libs.asm.tree)
34-
implementation("com.github.javaparser", "javaparser-symbol-solver-core", "3.24.4")
34+
implementation(libs.javaparser.symbol.solver)
3535

3636
testImplementation(libs.bytebuddy)
37-
testImplementation(libs.groovy)
37+
testImplementation(libs.bundles.groovy)
3838
testImplementation(libs.bundles.spock)
3939
testImplementation("javax.servlet", "javax.servlet-api", "3.0.1")
4040
testImplementation(libs.spotbugs.annotations)

buildSrc/call-site-instrumentation-plugin/src/test/groovy/datadog/trace/plugin/csi/impl/AdviceGeneratorTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ final class AdviceGeneratorTest extends BaseCsiPluginTest {
5959
class AroundAdvice {
6060
@CallSite.Around('java.lang.String java.lang.String.replaceAll(java.lang.String, java.lang.String)')
6161
static String around(@CallSite.This final String self, @CallSite.Argument final String regexp, @CallSite.Argument final String replacement) {
62-
return self.replaceAll(regexp, replacement);
62+
return self.replaceAll(regexp, replacement)
6363
}
6464
}
6565

@@ -228,7 +228,7 @@ final class AdviceGeneratorTest extends BaseCsiPluginTest {
228228
@CallSite.Argument final MethodType concatType,
229229
@CallSite.Argument final String recipe,
230230
@CallSite.Argument final Object... constants) {
231-
return null;
231+
return null
232232
}
233233
}
234234

@@ -270,7 +270,7 @@ final class AdviceGeneratorTest extends BaseCsiPluginTest {
270270
static String after(@CallSite.AllArguments final Object[] arguments,
271271
@CallSite.Return final String result,
272272
@CallSite.InvokeDynamicConstants final Object[] constants) {
273-
return result;
273+
return result
274274
}
275275
}
276276

buildSrc/call-site-instrumentation-plugin/src/test/groovy/datadog/trace/plugin/csi/impl/AdviceSpecificationTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ class AdviceSpecificationTest extends BaseCsiPluginTest {
548548
class AfterWithVoidWrongAdvice {
549549
@CallSite.After("void java.lang.String.getChars(int, int, char[], int)")
550550
static String after(@CallSite.AllArguments final Object[] args, @CallSite.Return final String result) {
551-
return result;
551+
return result
552552
}
553553
}
554554

buildSrc/call-site-instrumentation-plugin/src/test/groovy/datadog/trace/plugin/csi/impl/AsmSpecificationBuilderTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import datadog.trace.plugin.csi.impl.CallSiteSpecification.AfterSpecification
77
import datadog.trace.plugin.csi.impl.CallSiteSpecification.AroundSpecification
88
import datadog.trace.plugin.csi.impl.CallSiteSpecification.BeforeSpecification
99
import datadog.trace.plugin.csi.util.Types
10-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
10+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
1111
import groovy.transform.CompileDynamic
1212
import org.objectweb.asm.Type
1313

0 commit comments

Comments
 (0)