File tree Expand file tree Collapse file tree
main/java/datadog/telemetry
test/groovy/datadog/telemetry Expand file tree Collapse file tree Original file line number Diff line number Diff 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" ;
Original file line number Diff line number Diff line change @@ -5,6 +5,29 @@ import spock.lang.Specification
55
66class 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 )
You can’t perform that action at this time.
0 commit comments