Interface SpanStatusExtractor<REQUEST,​RESPONSE>

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface SpanStatusExtractor<REQUEST,​RESPONSE>
    Extractor of StatusCode, which will be called after a request and response is completed to determine its final status.
    • Method Detail

      • getDefault

        static <REQUEST,​RESPONSE> SpanStatusExtractor<REQUEST,​RESPONSE> getDefault()
        Returns the default SpanStatusExtractor, which returns StatusCode.ERROR if the framework returned an unhandled exception, or StatusCode.UNSET otherwise.
      • extract

        io.opentelemetry.api.trace.StatusCode extract​(REQUEST request,
                                                      RESPONSE response,
                                                      @Nullable Throwable error)
        Returns the StatusCode.