Class Java8BytecodeBridge

java.lang.Object
io.opentelemetry.javaagent.bootstrap.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.
  • Method Details

    • currentContext

      public static io.opentelemetry.context.Context currentContext()
      Calls Context.current().
    • rootContext

      public static io.opentelemetry.context.Context rootContext()
      Calls Context.root().
    • currentSpan

      public static io.opentelemetry.api.trace.Span currentSpan()
      Calls Span.current().
    • spanFromContext

      public static io.opentelemetry.api.trace.Span spanFromContext(io.opentelemetry.context.Context context)
      Calls Span.fromContext(Context).
    • baggageFromContext

      public static io.opentelemetry.api.baggage.Baggage baggageFromContext(io.opentelemetry.context.Context context)