Skip to content

Commit d57f54b

Browse files
Fix intake telemetry client URL for EU site (#6683)
1 parent 709ff74 commit d57f54b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

telemetry/src/main/java/datadog/telemetry/TelemetryClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private static String buildIntakeTelemetryUrl(Config config) {
5959
String prefix = "";
6060
if (site.endsWith("datad0g.com")) {
6161
prefix = "all-http-intake.logs.";
62-
} else if (site.endsWith("datadoghq.com")) {
62+
} else if (site.endsWith("datadoghq.com") || site.endsWith("datadoghq.eu")) {
6363
prefix = "instrumentation-telemetry-intake.";
6464
}
6565
return "https://" + prefix + site + "/api/v2/apmtelemetry";

telemetry/src/test/groovy/datadog/telemetry/TelemetryClientTest.groovy

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ import spock.lang.Specification
55

66
class TelemetryClientTest extends Specification {
77

8+
def "Intake client uses correct URL for site #site"() {
9+
setup:
10+
def config = Stub(Config)
11+
config.getApiKey() >> "dummy-key"
12+
config.getAgentTimeout() >> 123
13+
config.getSite() >> site
14+
15+
when:
16+
def intakeClient = TelemetryClient.buildIntakeClient(config)
17+
18+
then:
19+
intakeClient.getUrl().toString() == expectedUrl
20+
21+
where:
22+
site | expectedUrl
23+
"datadoghq.com" | "https://instrumentation-telemetry-intake.datadoghq.com/api/v2/apmtelemetry"
24+
"us3.datadoghq.com" | "https://instrumentation-telemetry-intake.us3.datadoghq.com/api/v2/apmtelemetry"
25+
"us5.datadoghq.com" | "https://instrumentation-telemetry-intake.us5.datadoghq.com/api/v2/apmtelemetry"
26+
"ap1.datadoghq.com" | "https://instrumentation-telemetry-intake.ap1.datadoghq.com/api/v2/apmtelemetry"
27+
"datadoghq.eu" | "https://instrumentation-telemetry-intake.datadoghq.eu/api/v2/apmtelemetry"
28+
"datad0g.com" | "https://all-http-intake.logs.datad0g.com/api/v2/apmtelemetry"
29+
}
30+
831
def "Intake client uses CI Visibility agentless URL if configured to do so"() {
932
setup:
1033
def config = Stub(Config)

0 commit comments

Comments
 (0)