Skip to content

Commit 435d92c

Browse files
committed
Merge remote-tracking branch 'origin/master' into bdu/convert-muzzle-to-kotlin
2 parents 4b09849 + f7aa6d2 commit 435d92c

File tree

1,831 files changed

+26927
-12322
lines changed

Some content is hidden

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

1,831 files changed

+26927
-12322
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
# @DataDog/asm-java (AppSec/IAST)
4646
/buildSrc/call-site-instrumentation-plugin/ @DataDog/asm-java
4747
/dd-java-agent/agent-iast/ @DataDog/asm-java
48+
/dd-java-agent/appsec/appsec-test-fixtures/ @DataDog/asm-java
4849
/dd-java-agent/instrumentation/*iast* @DataDog/asm-java
4950
/dd-java-agent/instrumentation/*appsec* @DataDog/asm-java
5051
/dd-java-agent/instrumentation/json/ @DataDog/asm-java
@@ -54,7 +55,7 @@
5455
/dd-smoke-tests/iast-util/ @DataDog/asm-java
5556
/dd-smoke-tests/spring-security/ @DataDog/asm-java
5657
/dd-java-agent/instrumentation/commons-fileupload/ @DataDog/asm-java
57-
/dd-java-agent/instrumentation/spring-security-5/ @DataDog/asm-java
58+
/dd-java-agent/instrumentation/spring/spring-security/ @DataDog/asm-java
5859
/dd-trace-api/src/main/java/datadog/trace/api/EventTracker.java @DataDog/asm-java
5960
/internal-api/src/main/java/datadog/trace/api/gateway/ @DataDog/asm-java
6061
**/appsec/ @DataDog/asm-java
@@ -87,15 +88,17 @@
8788
/dd-java-agent/instrumentation/maven-surefire/ @DataDog/ci-app-libraries-java
8889
/dd-java-agent/instrumentation/weaver/ @DataDog/ci-app-libraries-java
8990
/dd-smoke-tests/gradle/ @DataDog/ci-app-libraries-java
91+
/dd-smoke-tests/junit-console/ @DataDog/ci-app-libraries-java
9092
/dd-smoke-tests/maven/ @DataDog/ci-app-libraries-java
9193
/internal-api/src/main/java/datadog/trace/api/git/ @DataDog/ci-app-libraries-java
9294
**/civisibility/ @DataDog/ci-app-libraries-java
9395
**/CiVisibility*.java @DataDog/ci-app-libraries-java
9496
**/CiVisibility*.groovy @DataDog/ci-app-libraries-java
9597

9698
# @DataDog/debugger-java (Live Debugger)
97-
/dd-java-agent/agent-debugger/ @DataDog/debugger-java
98-
/dd-smoke-tests/debugger-integration-tests/ @DataDog/debugger-java
99+
/dd-java-agent/agent-debugger/ @DataDog/debugger-java
100+
/dd-smoke-tests/debugger-integration-tests/ @DataDog/debugger-java
101+
/internal-api/src/main/java/datadog/trace/api/debugger/ @DataDog/debugger-java
99102

100103
# @DataDog/data-jobs-monitoring
101104
/dd-java-agent/instrumentation/spark/ @DataDog/data-jobs-monitoring
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
issuer: https://gitlab.ddbuild.io
2+
3+
subject_pattern: "project_path:DataDog/apm-reliability/dd-trace-java:ref_type:(branch|tag):ref:.*"
4+
5+
permissions:
6+
contents: read
7+

.github/workflows/analyze-changes.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
${{ runner.os }}-gradle-
3636
3737
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
38+
uses: github/codeql-action/init@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.29.5
3939
with:
4040
languages: 'java'
4141
build-mode: 'manual'
@@ -52,7 +52,7 @@ jobs:
5252
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5353
5454
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
55-
uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
55+
uses: github/codeql-action/analyze@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.29.5
5656

5757
trivy:
5858
name: Analyze changes with Trivy
@@ -102,7 +102,7 @@ jobs:
102102
ls -laR "./workspace/.trivy"
103103
104104
- name: Run Trivy security scanner
105-
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0
105+
uses: aquasecurity/trivy-action@f9424c10c36e288d5fa79bd3dfd1aeb2d6eae808 # v0.33.0
106106
with:
107107
scan-type: rootfs
108108
scan-ref: './workspace/.trivy/'
@@ -115,7 +115,7 @@ jobs:
115115
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
116116

117117
- name: Upload Trivy scan results to GitHub Security tab
118-
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
118+
uses: github/codeql-action/upload-sarif@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.29.5
119119
if: always()
120120
with:
121121
sarif_file: 'trivy-results.sarif'

.gitlab-ci.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ variables:
3030
GRADLE_PLUGIN_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/"
3131
BUILDER_IMAGE_VERSION_PREFIX: "v25.07-" # use either an empty string (e.g. "") for latest images or a version followed by a hyphen (e.g. "v25.05-")
3232
REPO_NOTIFICATION_CHANNEL: "#apm-java-escalations"
33-
DEFAULT_TEST_JVMS: /^(8|11|17|21|stable)$/
33+
DEFAULT_TEST_JVMS: /^(8|11|17|21|25)$/ # the latest "stable" version is LTS v25
3434
PROFILE_TESTS:
3535
description: "Enable profiling of tests"
3636
value: "false"
@@ -61,14 +61,14 @@ workflow:
6161
- "17"
6262
- "21"
6363
- "25"
64-
- "stable"
6564
- "semeru11"
6665
- "oracle8"
6766
- "zulu8"
6867
- "semeru8"
6968
- "ibm8"
7069
- "zulu11"
7170
- "semeru17"
71+
# - "stable"
7272
CI_SPLIT: ["1/1"]
7373

7474
# Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
@@ -580,7 +580,7 @@ muzzle-dep-report:
580580
CI_USE_TEST_AGENT: "true"
581581
CI_AGENT_HOST: local-agent
582582
services:
583-
- name: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.31.1
583+
- name: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.33.1
584584
alias: local-agent
585585
variables:
586586
LOG_LEVEL: "DEBUG"
@@ -636,7 +636,7 @@ test_inst_latest:
636636
CACHE_TYPE: "latestDep"
637637
parallel:
638638
matrix:
639-
- testJvm: ["8", "17", "21", "stable"]
639+
- testJvm: ["8", "17", "21", "25"] # the latest "stable" version is LTS v25
640640
# Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
641641
# This emulates "parallel" by including it in the matrix
642642
CI_SPLIT: [ "1/6", "2/6", "3/6", "4/6", "5/6", "6/6"]
@@ -688,7 +688,7 @@ test_debugger:
688688
variables:
689689
GRADLE_TARGET: ":debuggerTest"
690690
CACHE_TYPE: "base"
691-
DEFAULT_TEST_JVMS: /^(8|11|17|21|stable|semeru8)$/
691+
DEFAULT_TEST_JVMS: /^(8|11|17|21|25|semeru8)$/ # the latest "stable" version is LTS v25
692692
parallel:
693693
matrix: *test_matrix
694694

@@ -908,8 +908,6 @@ verify_maven_central_deployment:
908908
when: never
909909
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
910910
when: on_success
911-
- when: manual
912-
allow_failure: true
913911
cache: # Cache is used to signal between the override_verify_maven_central and verify_maven_central_deployment jobs
914912
- key: $CI_PIPELINE_ID-OVERRIDE_SIGNAL
915913
paths:
@@ -954,13 +952,6 @@ publishing-gate:
954952
needs:
955953
- job: verify_maven_central_deployment
956954
optional: true # Required for releases only
957-
rules:
958-
- if: '$POPULATE_CACHE'
959-
when: on_success
960-
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
961-
when: on_success
962-
- when: manual
963-
allow_failure: true
964955

965956
configure_system_tests:
966957
variables:

.gitlab/collect_reports.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ function process_reports () {
6262
cp -r workspace/$project_to_save/build/reports/* $report_path/ 2>/dev/null || true
6363
cp workspace/$project_to_save/build/hs_err_pid*.log $report_path/ 2>/dev/null || true
6464
cp workspace/$project_to_save/build/javacore*.txt $report_path/ 2>/dev/null || true
65+
cp workspace/$project_to_save/build/dumps/*.* $report_path/ 2>/dev/null || true
6566
fi
6667
}
6768

.gitlab/macrobenchmarks.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
include:
2-
project: 'DataDog/benchmarking-platform-tools'
3-
file: 'images/templates/gitlab/notify-slo-breaches.template.yml'
4-
ref: '925e0a3e7dd628885f6fc69cdaea5c8cc9e212bc'
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'
56

67
.macrobenchmarks:
78
stage: macrobenchmarks
@@ -76,10 +77,9 @@ otel-latest:
7677

7778

7879
check-slo-breaches:
80+
extends: .check-slo-breaches
7981
stage: macrobenchmarks
8082
interruptible: true
81-
tags: ["arch:amd64"]
82-
image: registry.ddbuild.io/images/benchmarking-platform-tools-ubuntu:latest
8383
rules:
8484
- if: $POPULATE_CACHE
8585
when: never
@@ -127,6 +127,7 @@ check-slo-breaches:
127127
- platform/artifacts/
128128
expire_in: 1 week
129129
variables:
130+
DDOCTOSTS_POLICY: "self.gitlab.github-access.read"
130131
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID # The ID of the current project. This ID is unique across all projects on the GitLab instance.
131132
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME # "dd-trace-java"
132133
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built.

communication/gradle.lockfile

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ com.datadoghq:java-dogstatsd-client:4.4.3=compileClasspath,runtimeClasspath,test
1313
com.fasterxml.jackson.core:jackson-annotations:2.9.0=testCompileClasspath,testRuntimeClasspath
1414
com.fasterxml.jackson.core:jackson-core:2.9.9=testCompileClasspath,testRuntimeClasspath
1515
com.fasterxml.jackson.core:jackson-databind:2.9.9.3=testCompileClasspath,testRuntimeClasspath
16-
com.github.javaparser:javaparser-core:3.25.6=testCompileClasspath,testRuntimeClasspath
16+
com.github.javaparser:javaparser-core:3.25.6=codenarc,testCompileClasspath,testRuntimeClasspath
1717
com.github.jnr:jffi:1.2.23=compileClasspath,testCompileClasspath
1818
com.github.jnr:jffi:1.3.13=runtimeClasspath,testRuntimeClasspath
1919
com.github.jnr:jnr-a64asm:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -45,7 +45,7 @@ com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileCla
4545
com.squareup.okhttp3:mockwebserver:3.12.12=testCompileClasspath,testRuntimeClasspath
4646
com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath
4747
com.squareup.okio:okio:1.17.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
48-
com.thoughtworks.qdox:qdox:1.12.1=testRuntimeClasspath
48+
com.thoughtworks.qdox:qdox:1.12.1=codenarc,testRuntimeClasspath
4949
commons-codec:commons-codec:1.15=spotbugs
5050
commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath
5151
commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath
@@ -59,10 +59,10 @@ net.bytebuddy:byte-buddy-agent:1.17.5=testCompileClasspath,testRuntimeClasspath
5959
net.bytebuddy:byte-buddy:1.17.5=testCompileClasspath,testRuntimeClasspath
6060
net.jcip:jcip-annotations:1.0=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
6161
net.sf.saxon:Saxon-HE:11.4=spotbugs
62+
org.apache.ant:ant-antlr:1.10.14=codenarc
6263
org.apache.ant:ant-antlr:1.10.15=testRuntimeClasspath
63-
org.apache.ant:ant-antlr:1.9.15=codenarc
64+
org.apache.ant:ant-junit:1.10.14=codenarc
6465
org.apache.ant:ant-junit:1.10.15=testRuntimeClasspath
65-
org.apache.ant:ant-junit:1.9.15=codenarc
6666
org.apache.ant:ant-launcher:1.10.15=testRuntimeClasspath
6767
org.apache.ant:ant:1.10.15=testCompileClasspath,testRuntimeClasspath
6868
org.apache.bcel:bcel:6.5.0=spotbugs
@@ -77,37 +77,38 @@ org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
7777
org.checkerframework:checker-compat-qual:2.5.5=testCompileClasspath,testRuntimeClasspath
7878
org.checkerframework:checker-qual:3.13.0=testCompileClasspath,testRuntimeClasspath
7979
org.codehaus.groovy:groovy-all:3.0.24=testCompileClasspath,testRuntimeClasspath
80-
org.codehaus.groovy:groovy-ant:2.5.14=codenarc
80+
org.codehaus.groovy:groovy-ant:3.0.23=codenarc
8181
org.codehaus.groovy:groovy-ant:3.0.24=testCompileClasspath,testRuntimeClasspath
8282
org.codehaus.groovy:groovy-astbuilder:3.0.24=testCompileClasspath,testRuntimeClasspath
8383
org.codehaus.groovy:groovy-cli-picocli:3.0.24=testCompileClasspath,testRuntimeClasspath
8484
org.codehaus.groovy:groovy-console:3.0.24=testCompileClasspath,testRuntimeClasspath
8585
org.codehaus.groovy:groovy-datetime:3.0.24=testCompileClasspath,testRuntimeClasspath
86+
org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc
8687
org.codehaus.groovy:groovy-docgenerator:3.0.24=testCompileClasspath,testRuntimeClasspath
87-
org.codehaus.groovy:groovy-groovydoc:2.5.14=codenarc
88+
org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc
8889
org.codehaus.groovy:groovy-groovydoc:3.0.24=testCompileClasspath,testRuntimeClasspath
8990
org.codehaus.groovy:groovy-groovysh:3.0.24=testCompileClasspath,testRuntimeClasspath
9091
org.codehaus.groovy:groovy-jmx:3.0.24=testCompileClasspath,testRuntimeClasspath
91-
org.codehaus.groovy:groovy-json:2.5.14=codenarc
92+
org.codehaus.groovy:groovy-json:3.0.23=codenarc
9293
org.codehaus.groovy:groovy-json:3.0.24=testCompileClasspath,testRuntimeClasspath
9394
org.codehaus.groovy:groovy-jsr223:3.0.24=testCompileClasspath,testRuntimeClasspath
9495
org.codehaus.groovy:groovy-macro:3.0.24=testCompileClasspath,testRuntimeClasspath
9596
org.codehaus.groovy:groovy-nio:3.0.24=testCompileClasspath,testRuntimeClasspath
9697
org.codehaus.groovy:groovy-servlet:3.0.24=testCompileClasspath,testRuntimeClasspath
9798
org.codehaus.groovy:groovy-sql:3.0.24=testCompileClasspath,testRuntimeClasspath
9899
org.codehaus.groovy:groovy-swing:3.0.24=testCompileClasspath,testRuntimeClasspath
99-
org.codehaus.groovy:groovy-templates:2.5.14=codenarc
100+
org.codehaus.groovy:groovy-templates:3.0.23=codenarc
100101
org.codehaus.groovy:groovy-templates:3.0.24=testCompileClasspath,testRuntimeClasspath
101102
org.codehaus.groovy:groovy-test-junit5:3.0.24=testCompileClasspath,testRuntimeClasspath
102103
org.codehaus.groovy:groovy-test:3.0.24=testCompileClasspath,testRuntimeClasspath
103104
org.codehaus.groovy:groovy-testng:3.0.24=testCompileClasspath,testRuntimeClasspath
104-
org.codehaus.groovy:groovy-xml:2.5.14=codenarc
105+
org.codehaus.groovy:groovy-xml:3.0.23=codenarc
105106
org.codehaus.groovy:groovy-xml:3.0.24=testCompileClasspath,testRuntimeClasspath
106-
org.codehaus.groovy:groovy:2.5.14=codenarc
107+
org.codehaus.groovy:groovy:3.0.23=codenarc
107108
org.codehaus.groovy:groovy:3.0.24=testCompileClasspath,testRuntimeClasspath
108-
org.codenarc:CodeNarc:2.2.0=codenarc
109+
org.codenarc:CodeNarc:3.6.0=codenarc
109110
org.dom4j:dom4j:2.1.3=spotbugs
110-
org.gmetrics:GMetrics:1.1=codenarc
111+
org.gmetrics:GMetrics:2.1.0=codenarc
111112
org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath
112113
org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath
113114
org.jacoco:org.jacoco.agent:0.8.13=jacocoAgent,jacocoAnt

communication/src/main/java/datadog/communication/BackendApiFactory.java

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import datadog.communication.http.HttpRetryPolicy;
66
import datadog.communication.http.OkHttpUtils;
77
import datadog.trace.api.Config;
8+
import datadog.trace.api.intake.Intake;
89
import datadog.trace.util.throwable.FatalAgentMisconfigurationError;
9-
import java.util.function.Function;
1010
import javax.annotation.Nullable;
1111
import okhttp3.HttpUrl;
1212
import okhttp3.OkHttpClient;
@@ -28,8 +28,8 @@ public BackendApiFactory(Config config, SharedCommunicationObjects sharedCommuni
2828
public @Nullable BackendApi createBackendApi(Intake intake) {
2929
HttpRetryPolicy.Factory retryPolicyFactory = new HttpRetryPolicy.Factory(5, 100, 2.0, true);
3030

31-
if (intake.agentlessModeEnabled.apply(config)) {
32-
HttpUrl agentlessUrl = getAgentlessUrl(intake);
31+
if (intake.isAgentlessEnabled(config)) {
32+
HttpUrl agentlessUrl = HttpUrl.get(intake.getAgentlessUrl(config));
3333
String apiKey = config.getApiKey();
3434
if (apiKey == null || apiKey.isEmpty()) {
3535
throw new FatalAgentMisconfigurationError(
@@ -49,50 +49,19 @@ public BackendApiFactory(Config config, SharedCommunicationObjects sharedCommuni
4949
String traceId = config.getIdGenerationStrategy().generateTraceId().toString();
5050
String evpProxyEndpoint = featuresDiscovery.getEvpProxyEndpoint();
5151
HttpUrl evpProxyUrl = sharedCommunicationObjects.agentUrl.resolve(evpProxyEndpoint);
52+
String subdomain = intake.getUrlPrefix();
5253
return new EvpProxyApi(
53-
traceId, evpProxyUrl, retryPolicyFactory, sharedCommunicationObjects.okHttpClient, true);
54+
traceId,
55+
evpProxyUrl,
56+
subdomain,
57+
retryPolicyFactory,
58+
sharedCommunicationObjects.okHttpClient,
59+
true);
5460
}
5561

5662
log.warn(
5763
"Cannot create backend API client since agentless mode is disabled, "
5864
+ "and agent does not support EVP proxy");
5965
return null;
6066
}
61-
62-
private HttpUrl getAgentlessUrl(Intake intake) {
63-
String customUrl = intake.customUrl.apply(config);
64-
if (customUrl != null && !customUrl.isEmpty()) {
65-
return HttpUrl.get(String.format("%s/api/%s/", customUrl, intake.version));
66-
} else {
67-
String site = config.getSite();
68-
return HttpUrl.get(
69-
String.format("https://%s.%s/api/%s/", intake.urlPrefix, site, intake.version));
70-
}
71-
}
72-
73-
public enum Intake {
74-
API("api", "v2", Config::isCiVisibilityAgentlessEnabled, Config::getCiVisibilityAgentlessUrl),
75-
LLMOBS_API("api", "v2", Config::isLlmObsAgentlessEnabled, Config::getLlMObsAgentlessUrl),
76-
LOGS(
77-
"http-intake.logs",
78-
"v2",
79-
Config::isAgentlessLogSubmissionEnabled,
80-
Config::getAgentlessLogSubmissionUrl);
81-
82-
public final String urlPrefix;
83-
public final String version;
84-
public final Function<Config, Boolean> agentlessModeEnabled;
85-
public final Function<Config, String> customUrl;
86-
87-
Intake(
88-
String urlPrefix,
89-
String version,
90-
Function<Config, Boolean> agentlessModeEnabled,
91-
Function<Config, String> customUrl) {
92-
this.urlPrefix = urlPrefix;
93-
this.version = version;
94-
this.agentlessModeEnabled = agentlessModeEnabled;
95-
this.customUrl = customUrl;
96-
}
97-
}
9867
}

communication/src/main/java/datadog/communication/EvpProxyApi.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,25 @@ public class EvpProxyApi implements BackendApi {
2525
private static final String X_DATADOG_PARENT_ID_HEADER = "x-datadog-parent-id";
2626
private static final String ACCEPT_ENCODING_HEADER = "Accept-Encoding";
2727
private static final String CONTENT_ENCODING_HEADER = "Content-Encoding";
28-
private static final String API_SUBDOMAIN = "api";
2928
private static final String GZIP_ENCODING = "gzip";
3029

3130
private final String traceId;
3231
private final HttpRetryPolicy.Factory retryPolicyFactory;
3332
private final HttpUrl evpProxyUrl;
33+
private final String subdomain;
3434
private final OkHttpClient httpClient;
3535
private final boolean responseCompression;
3636

3737
public EvpProxyApi(
3838
String traceId,
3939
HttpUrl evpProxyUrl,
40+
String subdomain,
4041
HttpRetryPolicy.Factory retryPolicyFactory,
4142
OkHttpClient httpClient,
4243
boolean responseCompression) {
4344
this.traceId = traceId;
4445
this.evpProxyUrl = evpProxyUrl.resolve(String.format("api/%s/", API_VERSION));
46+
this.subdomain = subdomain;
4547
this.retryPolicyFactory = retryPolicyFactory;
4648
this.httpClient = httpClient;
4749
this.responseCompression = responseCompression;
@@ -60,7 +62,7 @@ public <T> T post(
6062
Request.Builder requestBuilder =
6163
new Request.Builder()
6264
.url(url)
63-
.addHeader(X_DATADOG_EVP_SUBDOMAIN_HEADER, API_SUBDOMAIN)
65+
.addHeader(X_DATADOG_EVP_SUBDOMAIN_HEADER, subdomain)
6466
.addHeader(X_DATADOG_TRACE_ID_HEADER, traceId)
6567
.addHeader(X_DATADOG_PARENT_ID_HEADER, traceId);
6668

0 commit comments

Comments
 (0)