You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not creating scopes when resetting scope on trace handler (#214)
without this change, we're using the `tracer.withSpan(null)` to reset the thread local, however the better alternative is to use the `CurrentTraceContext.maybeScope` mechanism.
with this change we're changing the way the `TracingObservationHandler` is clearing scopes. We also needed to improve the testing tracer to support these changes
fixesgh-213
Copy file name to clipboardExpand all lines: micrometer-tracing-bridges/micrometer-tracing-bridge-brave/src/test/java/io/micrometer/tracing/brave/bridge/BraveTracingApiTests.java
Copy file name to clipboardExpand all lines: micrometer-tracing-bridges/micrometer-tracing-bridge-otel/src/test/java/io/micrometer/tracing/otel/bridge/OtelTracingApiTests.java
Copy file name to clipboardExpand all lines: micrometer-tracing-tests/micrometer-tracing-test/src/main/java/io/micrometer/tracing/test/simple/SimpleCurrentTraceContext.java
+35-15
Original file line number
Diff line number
Diff line change
@@ -15,15 +15,15 @@
15
15
*/
16
16
packageio.micrometer.tracing.test.simple;
17
17
18
+
importio.micrometer.tracing.CurrentTraceContext;
19
+
importio.micrometer.tracing.Span;
20
+
importio.micrometer.tracing.TraceContext;
21
+
18
22
importjava.util.Objects;
19
23
importjava.util.concurrent.Callable;
20
24
importjava.util.concurrent.Executor;
21
25
importjava.util.concurrent.ExecutorService;
22
26
23
-
importio.micrometer.tracing.CurrentTraceContext;
24
-
importio.micrometer.tracing.Span;
25
-
importio.micrometer.tracing.TraceContext;
26
-
27
27
/**
28
28
* A test implementation of a current trace context.
29
29
*
@@ -53,22 +53,18 @@ public TraceContext context() {
Copy file name to clipboardExpand all lines: micrometer-tracing-tests/micrometer-tracing-test/src/main/java/io/micrometer/tracing/test/simple/SimpleSpan.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ public class SimpleSpan implements Span, FinishedSpan {
Copy file name to clipboardExpand all lines: micrometer-tracing-tests/micrometer-tracing-test/src/main/java/io/micrometer/tracing/test/simple/SimpleSpanAndScope.java
+3-25
Original file line number
Diff line number
Diff line change
@@ -15,16 +15,14 @@
15
15
*/
16
16
packageio.micrometer.tracing.test.simple;
17
17
18
-
importjava.util.Map;
19
-
importjava.util.Objects;
20
-
importjava.util.concurrent.ConcurrentHashMap;
21
-
22
18
importio.micrometer.common.lang.Nullable;
23
19
importio.micrometer.tracing.Span;
24
20
importio.micrometer.tracing.SpanAndScope;
25
21
importio.micrometer.tracing.TraceContext;
26
22
importio.micrometer.tracing.Tracer;
27
23
24
+
importjava.util.Objects;
25
+
28
26
/**
29
27
* Container object for {@link Span} and its corresponding {@link Tracer.SpanInScope}.
0 commit comments