From c21930b776ca632144418dd183bbe15f07d933c4 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Wed, 2 Sep 2020 16:52:02 +0900 Subject: [PATCH] Only set propagators when not provided. (#12) --- .../xray/opentelemetry/agentbootstrap/AwsAgentBootstrap.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/otelagent/src/main/java/com/softwareaws/xray/opentelemetry/agentbootstrap/AwsAgentBootstrap.java b/otelagent/src/main/java/com/softwareaws/xray/opentelemetry/agentbootstrap/AwsAgentBootstrap.java index 9f09e46..0c61d7e 100644 --- a/otelagent/src/main/java/com/softwareaws/xray/opentelemetry/agentbootstrap/AwsAgentBootstrap.java +++ b/otelagent/src/main/java/com/softwareaws/xray/opentelemetry/agentbootstrap/AwsAgentBootstrap.java @@ -28,7 +28,9 @@ public static void agentmain(final String agentArgs, final Instrumentation inst) System.setProperty( "io.opentelemetry.javaagent.shaded.io.opentelemetry.trace.spi.TracerProviderFactory", "com.softwareaws.xray.opentelemetry.exporters.AwsTracerProviderFactory"); - System.setProperty("otel.propagators", "xray,tracecontext,b3"); + if (System.getProperty("otel.propagators", "").isEmpty()) { + System.setProperty("otel.propagators", "xray,tracecontext,b3"); + } OpenTelemetryAgent.agentmain(agentArgs, inst); } }