diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HeliosConfiguration.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HeliosConfiguration.java index 520f94fa6eb1..602afbc8ee2f 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HeliosConfiguration.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/HeliosConfiguration.java @@ -16,6 +16,8 @@ public class HeliosConfiguration { public static final String HELIOS_ENVIRONMENT_ENV_VAR = "HS_ENVIRONMENT"; public static final String HELIOS_SERVICE_NAME_ENV_VAR = "HS_SERVICE_NAME"; public static final String HELIOS_TOKEN_ENV_VAR = "HS_TOKEN"; + public static final String HELIOS_COLLECTOR_ENDPOINT_ENV_VAR = "HS_COLLECTOR_ENDPOINT"; + public static final String DEFAULT_COLLECTOR_ENDPOINT = "https://collector.heliosphere.io/traces"; public static String getEnvironmentName() { return System.getenv(HELIOS_ENVIRONMENT_ENV_VAR); @@ -32,4 +34,9 @@ public static String getServiceName() { public static String getHsToken() { return System.getenv(HELIOS_TOKEN_ENV_VAR); } + + public static String getCollectorEndpoint() { + String result = System.getenv(HELIOS_COLLECTOR_ENDPOINT_ENV_VAR); + return result == null ? DEFAULT_COLLECTOR_ENDPOINT : result; + } } diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/OpenTelemetryInstaller.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/OpenTelemetryInstaller.java index 545986a05681..543fa6665d5c 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/OpenTelemetryInstaller.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/OpenTelemetryInstaller.java @@ -5,6 +5,7 @@ package io.opentelemetry.javaagent.tooling; +import static io.opentelemetry.javaagent.tooling.HeliosConfiguration.getCollectorEndpoint; import static io.opentelemetry.javaagent.tooling.HeliosConfiguration.getHsToken; import io.opentelemetry.instrumentation.api.appender.internal.LogEmitterProvider; @@ -68,8 +69,7 @@ static void setHeliosSystemProperties() { if (hsToken != null) { System.setProperty("otel.exporter.otlp.headers", String.format("Authorization=%s", hsToken)); - System.setProperty( - "otel.exporter.otlp.traces.endpoint", "https://collector.heliosphere.io/traces"); + System.setProperty("otel.exporter.otlp.traces.endpoint", getCollectorEndpoint()); System.setProperty("otel.exporter.otlp.traces.protocol", "http/protobuf"); } } diff --git a/version.gradle.kts b/version.gradle.kts index 104cc82ec7d7..a77e2e12c181 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -1,4 +1,4 @@ -val stableVersion = "1.0.2" +val stableVersion = "1.0.3" val alphaVersion = "1.17.1-alpha-SNAPSHOT" allprojects {