Class RpcClientAttributesExtractor<REQUEST,RESPONSE>

java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.rpc.RpcClientAttributesExtractor<REQUEST,RESPONSE>
All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>, io.opentelemetry.instrumentation.api.internal.SpanKeyProvider

public final class RpcClientAttributesExtractor<REQUEST,RESPONSE> extends Object implements io.opentelemetry.instrumentation.api.internal.SpanKeyProvider
Extractor of RPC client attributes.

This class delegates to a type-specific RpcAttributesGetter for individual attribute extraction from request/response objects.

  • Method Summary

    Modifier and Type
    Method
    Description
    static <REQUEST, RESPONSE>
    io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
    create(RpcAttributesGetter<REQUEST> getter)
    Creates the RPC client attributes extractor.
    io.opentelemetry.instrumentation.api.internal.SpanKey
    This method is internal and is hence not for public use.
    final void
    onEnd(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context context, REQUEST request, RESPONSE response, Throwable error)
     
    final void
    onStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static <REQUEST, RESPONSE> io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> create(RpcAttributesGetter<REQUEST> getter)
      Creates the RPC client attributes extractor.
    • internalGetSpanKey

      public io.opentelemetry.instrumentation.api.internal.SpanKey internalGetSpanKey()
      This method is internal and is hence not for public use. Its API is unstable and can change at any time.
      Specified by:
      internalGetSpanKey in interface io.opentelemetry.instrumentation.api.internal.SpanKeyProvider
    • onStart

      public final 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 final 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>