Class InstrumenterCustomizerImpl
java.lang.Object
io.opentelemetry.instrumentation.api.incubator.instrumenter.internal.InstrumenterCustomizerImpl
- All Implemented Interfaces:
InstrumenterCustomizer
This class is internal and is hence not for public use. Its APIs are unstable and can change at
any time.
-
Constructor Summary
ConstructorsConstructorDescriptionInstrumenterCustomizerImpl(io.opentelemetry.instrumentation.api.internal.InternalInstrumenterCustomizer customizer) -
Method Summary
Modifier and TypeMethodDescriptionaddAttributesExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<?, ?> extractor) Adds a singleAttributesExtractorto the instrumenter.addAttributesExtractors(Iterable<? extends io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<?, ?>> extractors) Adds multipleAttributesExtractors to the instrumenter.addContextCustomizer(io.opentelemetry.instrumentation.api.instrumenter.ContextCustomizer<?> customizer) Adds aContextCustomizerthat will customize the context duringInstrumenter.start(Context, Object).addOperationMetrics(io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics operationMetrics) Adds anOperationMetricsimplementation to the instrumenter.Returns the name of the instrumentation that this customizer applies to.setSpanNameExtractor(Function<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<?>, io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<?>> spanNameExtractorTransformer) Sets a transformer function that will modify theSpanNameExtractor.
-
Constructor Details
-
InstrumenterCustomizerImpl
public InstrumenterCustomizerImpl(io.opentelemetry.instrumentation.api.internal.InternalInstrumenterCustomizer customizer)
-
-
Method Details
-
getInstrumentationName
Description copied from interface:InstrumenterCustomizerReturns the name of the instrumentation that this customizer applies to.- Specified by:
getInstrumentationNamein interfaceInstrumenterCustomizer- Returns:
- the name of the instrumentation this customizer targets
-
addAttributesExtractor
public InstrumenterCustomizer addAttributesExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<?, ?> extractor) Description copied from interface:InstrumenterCustomizerAdds a singleAttributesExtractorto the instrumenter. This extractor will be used to extract attributes from requests and responses during the request lifecycle.- Specified by:
addAttributesExtractorin interfaceInstrumenterCustomizer- 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:InstrumenterCustomizerAdds multipleAttributesExtractors to the instrumenter. These extractors will be used to extract attributes from requests and responses during the request lifecycle.- Specified by:
addAttributesExtractorsin interfaceInstrumenterCustomizer- 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:InstrumenterCustomizerAdds anOperationMetricsimplementation to the instrumenter. This will be used to create metrics for the instrumented operations.- Specified by:
addOperationMetricsin interfaceInstrumenterCustomizer- 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:InstrumenterCustomizerAdds aContextCustomizerthat will customize the context duringInstrumenter.start(Context, Object).- Specified by:
addContextCustomizerin interfaceInstrumenterCustomizer- 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:InstrumenterCustomizerSets a transformer function that will modify theSpanNameExtractor. This allows customizing how span names are generated for the instrumented operations.- Specified by:
setSpanNameExtractorin interfaceInstrumenterCustomizer- Parameters:
spanNameExtractorTransformer- function that transforms the original span name extractor- Returns:
- this InstrumenterCustomizer for method chaining
-