Skip to content

Commit

Permalink
Fix intake telemetry client URL for EU site (#6683)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-tkachenko-datadog authored Feb 15, 2024
1 parent 709ff74 commit d57f54b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static String buildIntakeTelemetryUrl(Config config) {
String prefix = "";
if (site.endsWith("datad0g.com")) {
prefix = "all-http-intake.logs.";
} else if (site.endsWith("datadoghq.com")) {
} else if (site.endsWith("datadoghq.com") || site.endsWith("datadoghq.eu")) {
prefix = "instrumentation-telemetry-intake.";
}
return "https://" + prefix + site + "/api/v2/apmtelemetry";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ import spock.lang.Specification

class TelemetryClientTest extends Specification {

def "Intake client uses correct URL for site #site"() {
setup:
def config = Stub(Config)
config.getApiKey() >> "dummy-key"
config.getAgentTimeout() >> 123
config.getSite() >> site

when:
def intakeClient = TelemetryClient.buildIntakeClient(config)

then:
intakeClient.getUrl().toString() == expectedUrl

where:
site | expectedUrl
"datadoghq.com" | "https://instrumentation-telemetry-intake.datadoghq.com/api/v2/apmtelemetry"
"us3.datadoghq.com" | "https://instrumentation-telemetry-intake.us3.datadoghq.com/api/v2/apmtelemetry"
"us5.datadoghq.com" | "https://instrumentation-telemetry-intake.us5.datadoghq.com/api/v2/apmtelemetry"
"ap1.datadoghq.com" | "https://instrumentation-telemetry-intake.ap1.datadoghq.com/api/v2/apmtelemetry"
"datadoghq.eu" | "https://instrumentation-telemetry-intake.datadoghq.eu/api/v2/apmtelemetry"
"datad0g.com" | "https://all-http-intake.logs.datad0g.com/api/v2/apmtelemetry"
}

def "Intake client uses CI Visibility agentless URL if configured to do so"() {
setup:
def config = Stub(Config)
Expand Down

0 comments on commit d57f54b

Please sign in to comment.