diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/bci/ElasticApmAgent.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/bci/ElasticApmAgent.java index 0f1aa55480..05e092c94e 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/bci/ElasticApmAgent.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/bci/ElasticApmAgent.java @@ -163,7 +163,7 @@ public static void initialize(@Nullable final String agentArguments, final Instr // server log appender requires buffering log events before the config and reporter are ready. .withLifecycleListener(ApmServerLogAppender.getInstance().getInitListener()) .build(); - //initInstrumentation(tracer, instrumentation, premain); + initInstrumentation(tracer, instrumentation, premain); tracer.start(premain); } diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/ElasticApmTracer.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/ElasticApmTracer.java index a7fb2b80f7..711601c319 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/ElasticApmTracer.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/ElasticApmTracer.java @@ -737,7 +737,6 @@ private synchronized void startSync() { return; } apmServerClient.start(); - /* reporter.start(); for (LifecycleListener lifecycleListener : lifecycleListeners) { try { @@ -746,7 +745,6 @@ private synchronized void startSync() { logger.error("Failed to start " + lifecycleListener.getClass().getName(), e); } } - */ tracerState = TracerState.RUNNING; if (recordingConfigOptionSet) { logger.info("Tracer switched to RUNNING state"); diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/ApmServerClient.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/ApmServerClient.java index bef43b36a9..1bc971d72f 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/ApmServerClient.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/ApmServerClient.java @@ -114,8 +114,7 @@ public void onChange(ConfigurationOption configurationOption, List oldVa setServerUrls(reporterConfiguration.getServerUrls()); } }); - // TODO: why does this prevent duplicate logging? - // setServerUrls(Collections.unmodifiableList(shuffledUrls)); + setServerUrls(Collections.unmodifiableList(shuffledUrls)); } /** diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/util/ExecutorUtils.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/util/ExecutorUtils.java index cf138980d8..7a5029e318 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/util/ExecutorUtils.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/util/ExecutorUtils.java @@ -126,7 +126,7 @@ public Thread newThread(Runnable r) { String threadName = ThreadUtils.addElasticApmThreadPrefix(threadPurpose); thread.setName(threadName); ClassLoader originalContextCL = PrivilegedActionUtils.getContextClassLoader(thread); - PrivilegedActionUtils.setContextClassLoader(thread, PrivilegedActionUtils.getClassLoader(ExecutorUtils.class)); + //PrivilegedActionUtils.setContextClassLoader(thread, PrivilegedActionUtils.getClassLoader(ExecutorUtils.class)); logThreadCreation(originalContextCL, threadName); return thread; } @@ -158,7 +158,7 @@ public Thread newThread(Runnable r) { String threadName = ThreadUtils.addElasticApmThreadPrefix(threadPurpose) + "-" + threadCounter.getAndIncrement(); thread.setName(threadName); ClassLoader originalContextCL = PrivilegedActionUtils.getContextClassLoader(thread); - PrivilegedActionUtils.setContextClassLoader(thread, PrivilegedActionUtils.getClassLoader(ExecutorUtils.class)); + //PrivilegedActionUtils.setContextClassLoader(thread, PrivilegedActionUtils.getClassLoader(ExecutorUtils.class)); logThreadCreation(originalContextCL, threadName); return thread; }