init global tracer in premain
This commit is contained in:
parent
ae2b85ea51
commit
b231306f57
|
@ -24,6 +24,7 @@ public class AgentRulesManager {
|
||||||
public AgentRulesManager(final TracingAgentConfig config) {
|
public AgentRulesManager(final TracingAgentConfig config) {
|
||||||
agentTracerConfig = config;
|
agentTracerConfig = config;
|
||||||
instrumentationRulesManager = new InstrumentationRulesManager(config, this);
|
instrumentationRulesManager = new InstrumentationRulesManager(config, this);
|
||||||
|
instrumentationRulesManager.initTracer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method initializes the manager. */
|
/** This method initializes the manager. */
|
||||||
|
|
|
@ -120,11 +120,9 @@ public class InstrumentationRulesManager {
|
||||||
log.info("Initializing on classloader {}", classLoader);
|
log.info("Initializing on classloader {}", classLoader);
|
||||||
|
|
||||||
injector.inject(classLoader);
|
injector.inject(classLoader);
|
||||||
|
|
||||||
initTracer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initTracer() {
|
void initTracer() {
|
||||||
synchronized (SYNC) {
|
synchronized (SYNC) {
|
||||||
if (!GlobalTracer.isRegistered()) {
|
if (!GlobalTracer.isRegistered()) {
|
||||||
// Try to obtain a tracer using the TracerResolver
|
// Try to obtain a tracer using the TracerResolver
|
||||||
|
@ -135,6 +133,8 @@ public class InstrumentationRulesManager {
|
||||||
} catch (final RuntimeException re) {
|
} catch (final RuntimeException re) {
|
||||||
log.warn("Failed to register tracer '" + resolved + "'", re);
|
log.warn("Failed to register tracer '" + resolved + "'", re);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.warn("Failed to resolve dd tracer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue