File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
main/java/datadog/telemetry
test/groovy/datadog/telemetry Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ private static String buildIntakeTelemetryUrl(Config config) {
59
59
String prefix = "" ;
60
60
if (site .endsWith ("datad0g.com" )) {
61
61
prefix = "all-http-intake.logs." ;
62
- } else if (site .endsWith ("datadoghq.com" )) {
62
+ } else if (site .endsWith ("datadoghq.com" ) || site . endsWith ( "datadoghq.eu" ) ) {
63
63
prefix = "instrumentation-telemetry-intake." ;
64
64
}
65
65
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
5
5
6
6
class TelemetryClientTest extends Specification {
7
7
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
+
8
31
def " Intake client uses CI Visibility agentless URL if configured to do so" () {
9
32
setup :
10
33
def config = Stub (Config )
You can’t perform that action at this time.
0 commit comments