diff --git a/build.gradle b/build.gradle index 534782e2..8ac346a2 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ subprojects { opentelemetryJavaagent: "1.7.2", bytebuddy : "1.10.18", guava : "30.1-jre", - appopticsCore : "7.0.1", + appopticsCore : "7.0.2", appopticsMetrics : "7.0.0" ] versions.opentelemetryAlpha = "${versions.opentelemetry}-alpha" diff --git a/custom/src/main/java/com/appoptics/opentelemetry/extensions/AppOpticsProfilingSpanProcessor.java b/custom/src/main/java/com/appoptics/opentelemetry/extensions/AppOpticsProfilingSpanProcessor.java index fdab16b3..b04a596b 100644 --- a/custom/src/main/java/com/appoptics/opentelemetry/extensions/AppOpticsProfilingSpanProcessor.java +++ b/custom/src/main/java/com/appoptics/opentelemetry/extensions/AppOpticsProfilingSpanProcessor.java @@ -34,9 +34,10 @@ public void onStart(Context parentContext, ReadWriteSpan span) { SpanContext parentSpanContext = Span.fromContext(parentContext).getSpanContext(); if (!parentSpanContext.isValid() || parentSpanContext.isRemote()) { //then a root span of this service if (PROFILER_ENABLED) { - Metadata metadata = Util.buildMetadata(span.getSpanContext()); + SpanContext spanContext = span.getSpanContext(); + Metadata metadata = Util.buildMetadata(spanContext); if (metadata.isValid()) { - Profiler.addProfiledThread(Thread.currentThread(), metadata, metadata.getTraceId()); + Profiler.addProfiledThread(Thread.currentThread(), metadata, Metadata.bytesToHex(metadata.getTaskID())); span.setAttribute(SW_KEY_PREFIX + "ProfileSpans", 1); } } else { @@ -56,7 +57,7 @@ public void onEnd(ReadableSpan span) { if (span.getSpanContext().isSampled()) { //only profile on sampled spans SpanContext parentSpanContext = span.toSpanData().getParentSpanContext(); if (!parentSpanContext.isValid() || parentSpanContext.isRemote()) { //then a root span of this service - Profiler.stopProfile(Util.toTraceId(span.getSpanContext().getTraceIdBytes())); + Profiler.stopProfile(span.getSpanContext().getTraceId()); } } }