Class ServerAttributesExtractor<REQUEST,RESPONSE>

java.lang.Object
io.opentelemetry.instrumentation.api.instrumenter.network.ServerAttributesExtractor<REQUEST,RESPONSE>
All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>

public final class ServerAttributesExtractor<REQUEST,RESPONSE> extends Object implements io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
Extractor of server attributes.
  • Method Details

    • create

      public static <REQUEST, RESPONSE> ServerAttributesExtractor<REQUEST,RESPONSE> create(ServerAttributesGetter<REQUEST,RESPONSE> getter)
      Creates the server attributes extractor.
      See Also:
      • InstrumenterBuilder.addAttributesExtractor(AttributesExtractor)
    • createForServerSide

      @Deprecated public static <REQUEST, RESPONSE> ServerAttributesExtractor<REQUEST,RESPONSE> createForServerSide(ServerAttributesGetter<REQUEST,RESPONSE> getter)
      Deprecated.
      This method will be removed in the 2.0 release. It was only introduced to ease the transition from using the old NetServerAttributesGetter to the new ...network attribute getter classes.
      Returns a new ServerAttributesExtractor that will use the passed ServerAttributesGetter.
    • onStart

      public void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request)
      Specified by:
      onStart in interface io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
    • onEnd

      public void onEnd(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context context, REQUEST request, @Nullable RESPONSE response, @Nullable Throwable error)
      Specified by:
      onEnd in interface io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>