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
    • 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
    • setSpanNameExtractor

      public InstrumenterCustomizer setSpanNameExtractor(Function<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<?>,io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<?>> spanNameExtractorTransformer)
      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:
      setSpanNameExtractor in interface InstrumenterCustomizer
      Parameters:
      spanNameExtractorTransformer - function that transforms the original span name extractor
      Returns:
      this InstrumenterCustomizer for method chaining