Class Java8BytecodeBridge
- java.lang.Object
-
- io.opentelemetry.javaagent.instrumentation.api.Java8BytecodeBridge
-
public final class Java8BytecodeBridge extends Object
A helper for accessing methods that rely on new Java 8 bytecode features such as calling a static interface methods. In instrumentation, we may need to call these methods in code that is inlined into an instrumented class, however many times the instrumented class has been compiled to a previous version of bytecode and so we cannot inline calls to static interface methods, as those were not supported prior to Java 8 and will lead to a class verification error.
-
-
Constructor Summary
Constructors Constructor Description Java8BytecodeBridge()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.opentelemetry.context.ContextcurrentContext()CallsContext.current().static io.opentelemetry.api.trace.SpancurrentSpan()CallsSpan.current().static io.opentelemetry.context.propagation.ContextPropagatorsgetGlobalPropagators()static io.opentelemetry.api.trace.TracergetGlobalTracer(String name)CallsOpenTelemetry.getGlobalTracer(String).static io.opentelemetry.api.trace.SpanspanFromContext(io.opentelemetry.context.Context context)CallsSpan.fromContext(Context).
-
-
-
Method Detail
-
currentContext
public static io.opentelemetry.context.Context currentContext()
CallsContext.current().
-
currentSpan
public static io.opentelemetry.api.trace.Span currentSpan()
CallsSpan.current().
-
spanFromContext
public static io.opentelemetry.api.trace.Span spanFromContext(io.opentelemetry.context.Context context)
CallsSpan.fromContext(Context).
-
getGlobalPropagators
public static io.opentelemetry.context.propagation.ContextPropagators getGlobalPropagators()
-
getGlobalTracer
public static io.opentelemetry.api.trace.Tracer getGlobalTracer(String name)
CallsOpenTelemetry.getGlobalTracer(String).
-
-