java.lang.Object
io.opentelemetry.instrumentation.api.incubator.instrumenter.internal.InstrumenterCustomizerImpl
All Implemented Interfaces:
InstrumenterCustomizer

public final class InstrumenterCustomizerImpl extends Object implements InstrumenterCustomizer
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
  • Constructor Details

    • InstrumenterCustomizerImpl

      public InstrumenterCustomizerImpl(io.opentelemetry.instrumentation.api.internal.InternalInstrumenterCustomizer customizer)
  • Method Details

    • getInstrumentationName

      public String getInstrumentationName()
      Description copied from interface: InstrumenterCustomizer
      Returns the name of the instrumentation that this customizer applies to.
      Specified by:
      getInstrumentationName in interface InstrumenterCustomizer
      Returns:
      the name of the instrumentation this customizer targets
    • hasType

      public boolean hasType(InstrumenterCustomizer.InstrumentationType type)
      Description copied from interface: InstrumenterCustomizer
      Tests whether given instrumenter produces telemetry of specified type. Instrumentation type is detected based on the standard AttributesExtractor implementations used by this instrumenter e.g. instrumenters that use HttpClientAttributesExtractor have InstrumenterCustomizer.InstrumentationType.HTTP_CLIENT type.
      Specified by:
      hasType in interface InstrumenterCustomizer
      Returns:
      the name of the instrumentation this customizer targets
    • addAttributesExtractor

      public InstrumenterCustomizer addAttributesExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<?,?> extractor)
      Description copied from interface: InstrumenterCustomizer
      Adds a single AttributesExtractor to the instrumenter. This extractor will be used to extract attributes from requests and responses during the request lifecycle.
      Specified by:
      addAttributesExtractor in interface InstrumenterCustomizer
      Parameters:
      extractor - the attributes extractor to add
      Returns:
      this InstrumenterCustomizer for method chaining
    • addAttributesExtractors

      public InstrumenterCustomizer addAttributesExtractors(Iterable<? extends io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<?,?>> extractors)
      Description copied from interface: InstrumenterCustomizer
      Adds multiple AttributesExtractors to the instrumenter. These extractors will be used to extract attributes from requests and responses during the request lifecycle.
      Specified by:
      addAttributesExtractors in interface InstrumenterCustomizer
      Parameters:
      extractors - the collection of attributes extractors to add
      Returns:
      this InstrumenterCustomizer for method chaining
    • addOperationMetrics

      public InstrumenterCustomizer addOperationMetrics(io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics operationMetrics)
      Description copied from interface: InstrumenterCustomizer
      Adds an OperationMetrics implementation to the instrumenter. This will be used to create metrics for the instrumented operations.
      Specified by:
      addOperationMetrics in interface InstrumenterCustomizer
      Parameters:
      operationMetrics - the metrics factory to add
      Returns:
      this InstrumenterCustomizer for method chaining
    • addContextCustomizer

      public InstrumenterCustomizer addContextCustomizer(io.opentelemetry.instrumentation.api.instrumenter.ContextCustomizer<?> customizer)
      Description copied from interface: InstrumenterCustomizer
      Adds a ContextCustomizer that will customize the context during Instrumenter.start(Context, Object).
      Specified by:
      addContextCustomizer in interface InstrumenterCustomizer
      Parameters:
      customizer - the context customizer to add
      Returns:
      this InstrumenterCustomizer for method chaining
    • setSpanNameExtractorCustomizer

      public InstrumenterCustomizer setSpanNameExtractorCustomizer(UnaryOperator<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<?>> spanNameExtractorCustomizer)
      Description copied from interface: InstrumenterCustomizer
      Sets a transformer function that will modify the SpanNameExtractor. This allows customizing how span names are generated for the instrumented operations.
      Specified by:
      setSpanNameExtractorCustomizer in interface InstrumenterCustomizer
      Parameters:
      spanNameExtractorCustomizer - function that transforms the original span name extractor
      Returns:
      this InstrumenterCustomizer for method chaining
    • setSpanStatusExtractorCustomizer

      public InstrumenterCustomizer setSpanStatusExtractorCustomizer(UnaryOperator<io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<?,?>> spanStatusExtractorCustomizer)
      Description copied from interface: InstrumenterCustomizer
      Sets a transformer function that will modify the SpanStatusExtractor. This allows customizing how span statuses are generated for the instrumented operations.
      Specified by:
      setSpanStatusExtractorCustomizer in interface InstrumenterCustomizer
      Parameters:
      spanStatusExtractorCustomizer - function that transforms the original span status extractor
      Returns:
      this InstrumenterCustomizer for method chaining