From ff0418da7cdc6a159130ca9f70fab36397926173 Mon Sep 17 00:00:00 2001 From: James McMullan Date: Tue, 17 Sep 2024 15:22:52 -0400 Subject: [PATCH] HPCC4J-647 FileUtility only use otel autosdk without javaagent - Added a check to only initialize the OTel autosdk if an OTel javaagent hasn't been set Signed-off-by: James McMullan James.McMullan@lexisnexis.com --- .../main/java/org/hpccsystems/dfs/client/FileUtility.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dfsclient/src/main/java/org/hpccsystems/dfs/client/FileUtility.java b/dfsclient/src/main/java/org/hpccsystems/dfs/client/FileUtility.java index e522b1e50..01cfe91b1 100644 --- a/dfsclient/src/main/java/org/hpccsystems/dfs/client/FileUtility.java +++ b/dfsclient/src/main/java/org/hpccsystems/dfs/client/FileUtility.java @@ -2140,7 +2140,10 @@ public static JSONArray run(String[] args) System.out.println(" otel.metrics.exporter: "+ System.getProperty("otel.metrics.exporter")); System.out.println(" OTEL_METRICS_EXPORTER Env var: " + System.getenv("OTEL_METRICS_EXPORTER")); - OpenTelemetry otel = AutoConfiguredOpenTelemetrySdk.initialize().getOpenTelemetrySdk(); + if (!org.hpccsystems.ws.client.utils.Utils.isOtelJavaagentUsed()) + { + AutoConfiguredOpenTelemetrySdk.initialize().getOpenTelemetrySdk(); + } } otelInitialized = true;