Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC4J-647 FileUtility only use otel autosdk without javaagent #758

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class FileUtility
private static final int NUM_DEFAULT_THREADS = 4;
static private final int DEFAULT_ACCESS_EXPIRY_SECONDS = 120;

private static boolean otelInitialized = false;
private static boolean otelNeedsInit = true;

private static class TaskContext
{
Expand Down Expand Up @@ -1973,7 +1973,7 @@ private static void performWrite(String[] args, TaskContext context)
*/
public static JSONArray run(String[] args)
{
if (!otelInitialized)
if (otelNeedsInit)
{
if (Boolean.getBoolean("otel.java.global-autoconfigure.enabled"))
{
Expand All @@ -1989,10 +1989,13 @@ 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();
rpastrana marked this conversation as resolved.
Show resolved Hide resolved
}
}

otelInitialized = true;
otelNeedsInit = false;
}

Options options = getTopLevelOptions();
Expand Down
Loading