Class JfrSpanProcessor

  • All Implemented Interfaces:
    io.opentelemetry.sdk.trace.SpanProcessor, Closeable, AutoCloseable

    public final class JfrSpanProcessor
    extends Object
    implements io.opentelemetry.sdk.trace.SpanProcessor
    Span processor to create new JFR events for the Span as they are started, and commit on end.

    NOTE: The JfrSpanProcessor measures the timing of spans, avoid if possible to wrap it with any other SpanProcessor which may affect timings. When possible, register it first before any other processors to allow the most accurate measurements.

    • Constructor Detail

      • JfrSpanProcessor

        public JfrSpanProcessor()
    • Method Detail

      • onStart

        public void onStart​(io.opentelemetry.context.Context parentContext,
                            io.opentelemetry.sdk.trace.ReadWriteSpan span)
        Specified by:
        onStart in interface io.opentelemetry.sdk.trace.SpanProcessor
      • isStartRequired

        public boolean isStartRequired()
        Specified by:
        isStartRequired in interface io.opentelemetry.sdk.trace.SpanProcessor
      • onEnd

        public void onEnd​(io.opentelemetry.sdk.trace.ReadableSpan rs)
        Specified by:
        onEnd in interface io.opentelemetry.sdk.trace.SpanProcessor
      • isEndRequired

        public boolean isEndRequired()
        Specified by:
        isEndRequired in interface io.opentelemetry.sdk.trace.SpanProcessor
      • shutdown

        public io.opentelemetry.sdk.common.CompletableResultCode shutdown()
        Specified by:
        shutdown in interface io.opentelemetry.sdk.trace.SpanProcessor