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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.opentelemetry.instrumentation.api.incubator.instrumenter.InstrumenterCustomizer
InstrumenterCustomizer.InstrumentationType -
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.booleanTests whether given instrumenter produces telemetry of specified type.setSpanNameExtractorCustomizer(UnaryOperator<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<?>> spanNameExtractorCustomizer) Sets a transformer function that will modify theSpanNameExtractor.setSpanStatusExtractorCustomizer(UnaryOperator<io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<?, ?>> spanStatusExtractorCustomizer) Sets a transformer function that will modify theSpanStatusExtractor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.opentelemetry.instrumentation.api.incubator.instrumenter.InstrumenterCustomizer
setSpanNameExtractor, setSpanStatusExtractor
-
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
-
hasType
Description copied from interface:InstrumenterCustomizerTests whether given instrumenter produces telemetry of specified type. Instrumentation type is detected based on the standardAttributesExtractorimplementations used by this instrumenter e.g. instrumenters that useHttpClientAttributesExtractorhaveInstrumenterCustomizer.InstrumentationType.HTTP_CLIENTtype.- Specified by:
hasTypein 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
-
setSpanNameExtractorCustomizer
public InstrumenterCustomizer setSpanNameExtractorCustomizer(UnaryOperator<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<?>> spanNameExtractorCustomizer) 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:
setSpanNameExtractorCustomizerin interfaceInstrumenterCustomizer- 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:InstrumenterCustomizerSets a transformer function that will modify theSpanStatusExtractor. This allows customizing how span statuses are generated for the instrumented operations.- Specified by:
setSpanStatusExtractorCustomizerin interfaceInstrumenterCustomizer- Parameters:
spanStatusExtractorCustomizer- function that transforms the original span status extractor- Returns:
- this InstrumenterCustomizer for method chaining
-