From 65e2c9e4c44a1541ccbd2671702e3923a5ea9442 Mon Sep 17 00:00:00 2001 From: Thomas Vitale Date: Thu, 19 Sep 2024 20:48:38 +0200 Subject: [PATCH] Make OtelSpan publicly accessible (#809) Fixes gh-808 Signed-off-by: Thomas Vitale --- .../micrometer/tracing/otel/bridge/OtelSpan.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/micrometer-tracing-bridges/micrometer-tracing-bridge-otel/src/main/java/io/micrometer/tracing/otel/bridge/OtelSpan.java b/micrometer-tracing-bridges/micrometer-tracing-bridge-otel/src/main/java/io/micrometer/tracing/otel/bridge/OtelSpan.java index aac0008b..c32258ff 100644 --- a/micrometer-tracing-bridges/micrometer-tracing-bridge-otel/src/main/java/io/micrometer/tracing/otel/bridge/OtelSpan.java +++ b/micrometer-tracing-bridges/micrometer-tracing-bridge-otel/src/main/java/io/micrometer/tracing/otel/bridge/OtelSpan.java @@ -31,36 +31,36 @@ * @author Marcin Grzejszczak * @since 1.0.0 */ -class OtelSpan implements Span { +public class OtelSpan implements Span { final io.opentelemetry.api.trace.Span delegate; final OtelTraceContext otelTraceContext; - OtelSpan(io.opentelemetry.api.trace.Span delegate) { + public OtelSpan(io.opentelemetry.api.trace.Span delegate) { this.delegate = delegate; this.otelTraceContext = new OtelTraceContext(delegate.getSpanContext(), delegate); } - OtelSpan(io.opentelemetry.api.trace.Span delegate, Context context) { + public OtelSpan(io.opentelemetry.api.trace.Span delegate, Context context) { this.delegate = delegate; this.otelTraceContext = new OtelTraceContext(context, delegate.getSpanContext(), delegate); } - OtelSpan(OtelTraceContext traceContext) { + public OtelSpan(OtelTraceContext traceContext) { this.delegate = traceContext.span != null ? traceContext.span : io.opentelemetry.api.trace.Span.current(); this.otelTraceContext = traceContext; } - static io.opentelemetry.api.trace.Span toOtel(Span span) { + public static io.opentelemetry.api.trace.Span toOtel(Span span) { return ((OtelSpan) span).delegate; } - static Span fromOtel(io.opentelemetry.api.trace.Span span) { + public static Span fromOtel(io.opentelemetry.api.trace.Span span) { return new OtelSpan(span); } - static Span fromOtel(io.opentelemetry.api.trace.Span span, Context context) { + public static Span fromOtel(io.opentelemetry.api.trace.Span span, Context context) { return new OtelSpan(span, context); }