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); } }