Skip to content

Commit

Permalink
Disable payload compression when reporting on local server
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Bonafonte committed Oct 13, 2021
1 parent 8c75c16 commit cffe708
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/DatadogSDKTesting/DDTracer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ internal class DDTracer {
endpoint = Endpoint.us1
}

var payloadCompression = true
// When reporting tests to local server
if let localPort = env.localTestEnvironmentPort {
let localURL = URL(string: "http://localhost:\(localPort)/")!
endpoint = Endpoint.custom(tracesURL: localURL, logsURL: localURL, metricsURL: localURL)
Log.print("Reporting tests to \(localURL.absoluteURL)")
payloadCompression = false
}

let exporterConfiguration = ExporterConfiguration(
Expand All @@ -90,6 +92,7 @@ internal class DDTracer {
environment: env.ddEnvironment ?? (env.isCi ? "ci" : "none"),
apiKey: env.ddApikeyOrClientToken ?? "",
endpoint: endpoint,
payloadCompression: payloadCompression,
uploadCondition: { true },
performancePreset: .instantDataDelivery,
exportUnsampledSpans: false,
Expand Down

0 comments on commit cffe708

Please sign in to comment.