Skip to content

Commit 12425c2

Browse files
committed
Fix span listener registration in error case
1 parent 4e304fb commit 12425c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apm-agent-core/src/main/java/co/elastic/apm/agent/universalprofiling/UniversalProfilingIntegration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ public void start(ElasticApmTracer tracer) {
7474
ByteBuffer processCorrelationStorage = ProfilerSharedMemoryWriter.generateProcessCorrelationStorage(
7575
coreConfig.getServiceName(), coreConfig.getEnvironment(), "");
7676
UniversalProfilingCorrelation.setProcessStorage(processCorrelationStorage);
77+
78+
isActive = true;
79+
tracer.registerSpanListener(activationListener);
7780
} catch (Exception e) {
7881
log.error("Failed to start universal profiling integration", e);
7982
}
80-
isActive = true;
81-
tracer.registerSpanListener(activationListener);
8283
}
8384

8485
public void stop() {

0 commit comments

Comments
 (0)