Skip to content

Commit 48092fe

Browse files
authored
Merge branch 'master' into adrien.boitreaud/no-sql-failed-reset
2 parents 8d1a7c9 + e2d98c0 commit 48092fe

163 files changed

Lines changed: 8762 additions & 2384 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.

.github/g2j-migrated-modules.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77

88
buildSrc/call-site-instrumentation-plugin
99
components/json
10+
dd-java-agent/instrumentation/sofarpc/sofarpc-5.0
1011
dd-trace-api

.github/workflows/analyze-changes.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
submodules: 'recursive'
2222
- name: Cache Gradle dependencies
23-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
23+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
2424
with:
2525
path: |
2626
~/.gradle/caches
@@ -30,7 +30,7 @@ jobs:
3030
${{ runner.os }}-gradle-
3131
3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
33+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
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@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
46+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
4747

4848
trivy:
4949
name: Analyze changes with Trivy
@@ -60,7 +60,7 @@ jobs:
6060
submodules: 'recursive'
6161

6262
- name: Cache Gradle dependencies
63-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
63+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
6464
with:
6565
path: |
6666
~/.gradle/caches
@@ -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@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
105+
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
106106
if: always()
107107
with:
108108
sarif_file: 'trivy-results.sarif'

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
fetch-depth: 0
3131

3232
- name: Cache Gradle dependencies
33-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
33+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
3434
with:
3535
path: |
3636
~/.gradle/caches
@@ -75,7 +75,7 @@ jobs:
7575
desired_execution_time: 900 # 15 minutes
7676
scenarios_groups: tracer-release
7777
excluded_scenarios: APM_TRACING_E2E_OTEL,APM_TRACING_E2E_SINGLE_SPAN,PROFILING # exclude flaky scenarios
78-
skip_empty_scenarios: true
78+
skip_empty_scenarios: ${{ github.event_name != 'push' && github.event_name != 'schedule' }}
7979
push_to_test_optimization: true
8080
secrets:
8181
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}

.gitlab-ci.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,26 @@ include:
77
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
88
file: '.gitlab/ci-java-spring-petclinic-parallel.yml'
99
ref: 'main'
10+
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
11+
file: '.gitlab/ci-java-load-parallel.yml'
12+
ref: 'main'
13+
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
14+
file: '.gitlab/ci-java-startup-parallel.yml'
15+
ref: 'main'
16+
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
17+
file: '.gitlab/ci-java-dacapo-parallel.yml'
18+
ref: 'main'
19+
- local: ".gitlab/java-benchmark-configs.yml"
1020

1121
stages:
1222
- build
1323
- publish
1424
# These benchmarks are intended to replace the legacy benchmarks in the future
1525
- java-spring-petclinic-parallel
1626
- java-spring-petclinic-parallel-slo
27+
- java-startup-parallel
28+
- java-load-parallel
29+
- java-dacapo-parallel
1730
- shared-pipeline
1831
- benchmarks
1932
- macrobenchmarks
@@ -1023,11 +1036,12 @@ verify_maven_central_deployment:
10231036
"https://repo1.maven.org/maven2/com/datadoghq/dd-trace-api/${VERSION}/dd-trace-api-${VERSION}.jar"
10241037
"https://repo1.maven.org/maven2/com/datadoghq/dd-trace-ot/${VERSION}/dd-trace-ot-${VERSION}.jar"
10251038
)
1026-
# Wait 5 mins initially, then try 5 times with a minute delay between each retry to see if the release artifacts are available
1027-
sleep 300
1039+
# Try once immediately (fast path on job retry), then wait 5 mins for initial propagation,
1040+
# then try 4 more times with a minute delay between each retry.
10281041
TRY=0
1029-
MAX_TRIES=5
1030-
DELAY=60
1042+
MAX_TRIES=6
1043+
INITIAL_DELAY=300
1044+
RETRY_DELAY=60
10311045
while [ $TRY -lt $MAX_TRIES ]; do
10321046
ARTIFACTS_AVAILABLE=true
10331047
for URL in "${ARTIFACT_URLS[@]}"; do
@@ -1044,7 +1058,11 @@ verify_maven_central_deployment:
10441058
echo "The release was not available after 10 mins. Manually re-run the job to try again."
10451059
exit 1
10461060
fi
1047-
sleep $DELAY
1061+
if [ $TRY -eq 1 ]; then
1062+
sleep $INITIAL_DELAY
1063+
else
1064+
sleep $RETRY_DELAY
1065+
fi
10481066
done
10491067
10501068
publishing-gate:

.gitlab/java-benchmark-configs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Ensure the tracer artifact publish finishes before the benchmark jobs start.
2+
linux-java-spring-petclinic-parallel:
3+
needs: ["publish-artifacts-to-s3"]
4+
5+
linux-java-insecure-bank-load-parallel:
6+
needs: ["publish-artifacts-to-s3"]
7+
8+
linux-java-spring-petclinic-load-parallel:
9+
needs: ["publish-artifacts-to-s3"]
10+
11+
linux-java-insecure-bank-startup-parallel:
12+
needs: ["publish-artifacts-to-s3"]
13+
14+
linux-java-spring-petclinic-startup-parallel:
15+
needs: ["publish-artifacts-to-s3"]
16+
17+
linux-java-dacapo-parallel-1:
18+
needs: ["publish-artifacts-to-s3"]
19+
20+
linux-java-dacapo-parallel-2:
21+
needs: ["publish-artifacts-to-s3"]

.gitlab/one-pipeline.locked.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# DO NOT EDIT THIS FILE MANUALLY
22
# This file is auto-generated by automation.
33
include:
4-
- remote: https://gitlab-templates.ddbuild.io/libdatadog/one-pipeline/ca/4667b01c6ae983f92ecf106e110ced3dac798b229cf2a0539c58aa22e95a99d5/one-pipeline.yml
4+
- remote: https://gitlab-templates.ddbuild.io/libdatadog/one-pipeline/ca/0a900a87c53d3a57a5ab007b3147db4601f15c73ff31dc65f3791c803f2651d9/one-pipeline.yml

communication/src/main/java/datadog/communication/ddagent/DDAgentFeaturesDiscovery.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static datadog.communication.http.OkHttpUtils.msgpackRequestBodyOf;
55
import static datadog.communication.http.OkHttpUtils.prepareRequest;
66
import static datadog.communication.serialization.msgpack.MsgPackWriter.FIXARRAY;
7+
import static datadog.trace.api.ProtocolVersion.V0_4;
78
import static java.util.Collections.emptyMap;
89
import static java.util.Collections.emptySet;
910
import static java.util.Collections.singletonList;
@@ -17,10 +18,10 @@
1718
import datadog.metrics.api.Recording;
1819
import datadog.metrics.impl.statsd.DDAgentStatsDClientManager;
1920
import datadog.trace.api.BaseHash;
21+
import datadog.trace.api.ProtocolVersion;
2022
import datadog.trace.api.telemetry.LogCollector;
2123
import datadog.trace.util.Strings;
2224
import java.nio.ByteBuffer;
23-
import java.security.NoSuchAlgorithmException;
2425
import java.util.HashSet;
2526
import java.util.List;
2627
import java.util.Map;
@@ -50,6 +51,7 @@ public class DDAgentFeaturesDiscovery implements DroppingPolicy {
5051
public static final String V03_ENDPOINT = "v0.3/traces";
5152
public static final String V04_ENDPOINT = "v0.4/traces";
5253
public static final String V05_ENDPOINT = "v0.5/traces";
54+
public static final String V1_ENDPOINT = "v1.0/traces";
5355

5456
public static final String V06_METRICS_ENDPOINT = "v0.6/stats";
5557
public static final String V07_CONFIG_ENDPOINT = "v0.7/config";
@@ -72,7 +74,7 @@ public class DDAgentFeaturesDiscovery implements DroppingPolicy {
7274
private final OkHttpClient client;
7375
private final HttpUrl agentBaseUrl;
7476
private final Recording discoveryTimer;
75-
private final String[] traceEndpoints;
77+
private final ProtocolVersion protocolVersion;
7678
private final String[] metricsEndpoints = {V06_METRICS_ENDPOINT};
7779
private final String[] configEndpoints = {V07_CONFIG_ENDPOINT};
7880
private final boolean metricsEnabled;
@@ -107,15 +109,12 @@ public DDAgentFeaturesDiscovery(
107109
OkHttpClient client,
108110
Monitoring monitoring,
109111
HttpUrl agentUrl,
110-
boolean enableV05Traces,
112+
ProtocolVersion protocolVersion,
111113
boolean metricsEnabled) {
112114
this.client = client;
113115
this.agentBaseUrl = agentUrl;
114116
this.metricsEnabled = metricsEnabled;
115-
this.traceEndpoints =
116-
enableV05Traces
117-
? new String[] {V05_ENDPOINT, V04_ENDPOINT, V03_ENDPOINT}
118-
: new String[] {V04_ENDPOINT, V03_ENDPOINT};
117+
this.protocolVersion = protocolVersion != null ? protocolVersion : V0_4;
119118
this.discoveryTimer = monitoring.newTimer("trace.agent.discovery.time");
120119
this.discoveryState = new State();
121120
}
@@ -173,10 +172,10 @@ private void doDiscovery(State newState) {
173172

174173
// don't want to rewire the traces pipeline
175174
if (null == newState.traceEndpoint) {
176-
newState.traceEndpoint = probeTracesEndpoint(newState, traceEndpoints);
175+
newState.traceEndpoint = probeTracesEndpoint(newState, protocolVersion.endpointsToProbe());
177176
} else if (newState.state == null || newState.state.isEmpty()) {
178177
// Still need to probe so that state is correctly assigned
179-
probeTracesEndpoint(newState, new String[] {newState.traceEndpoint});
178+
probeTracesEndpoint(newState, singletonList(newState.traceEndpoint));
180179
}
181180
}
182181

@@ -194,7 +193,7 @@ private void doDiscovery(State newState) {
194193
}
195194
}
196195

197-
private String probeTracesEndpoint(State newState, String[] endpoints) {
196+
private String probeTracesEndpoint(State newState, List<String> endpoints) {
198197
for (String candidate : endpoints) {
199198
try (Response response =
200199
client
@@ -253,7 +252,7 @@ private boolean processInfoResponse(State newState, String response) {
253252
// This is done outside of the loop to set metricsEndpoint to null if not found
254253
newState.metricsEndpoint = foundMetricsEndpoint;
255254

256-
for (String endpoint : traceEndpoints) {
255+
for (String endpoint : protocolVersion.endpointsToProbe()) {
257256
if (containsEndpoint(endpoints, endpoint)) {
258257
newState.traceEndpoint = endpoint;
259258
break;
@@ -311,7 +310,7 @@ private boolean processInfoResponse(State newState, String response) {
311310
}
312311
try {
313312
newState.state = Strings.sha256(response);
314-
} catch (NoSuchAlgorithmException ex) {
313+
} catch (Throwable ex) {
315314
log.debug(
316315
"Failed to hash trace agent /info response. Will probe {}", newState.traceEndpoint, ex);
317316
}

communication/src/main/java/datadog/communication/ddagent/SharedCommunicationObjects.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public DDAgentFeaturesDiscovery featuresDiscovery(Config config) {
173173
agentHttpClient,
174174
monitoring,
175175
agentUrl,
176-
config.isTraceAgentV05Enabled(),
176+
config.getProtocolVersion(),
177177
config.isTracerMetricsEnabled());
178178

179179
if (paused) {

communication/src/main/java/datadog/communication/serialization/Writable.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ public interface Writable {
2727

2828
void writeBinary(byte[] binary, int offset, int length);
2929

30+
/**
31+
* Encodes 128 bits as binary.
32+
*
33+
* @param hi the high-order 64 bits.
34+
* @param lo The low-order 64 bits.
35+
*/
36+
void writeBinary(long hi, long lo);
37+
3038
/**
3139
* Start a part of the message containing key-value pairs
3240
*

communication/src/main/java/datadog/communication/serialization/msgpack/MsgPackWriter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ public void writeBinary(byte[] binary, int offset, int length) {
213213
buffer.put(binary, offset, length);
214214
}
215215

216+
@Override
217+
public void writeBinary(long hi, long lo) {
218+
writeBinaryHeader(16);
219+
buffer.putLong(hi);
220+
buffer.putLong(lo);
221+
}
222+
216223
@Override
217224
public void writeBinary(ByteBuffer binary) {
218225
ByteBuffer slice = binary.slice();

0 commit comments

Comments
 (0)