Class AutoConfiguredOpenTelemetrySdkBuilder
- All Implemented Interfaces:
AutoConfigurationCustomizer
- Since:
- 1.28.0
-
Method Summary
Modifier and TypeMethodDescriptionaddLoggerProviderCustomizer(BiFunction<SdkLoggerProviderBuilder, ConfigProperties, SdkLoggerProviderBuilder> loggerProviderCustomizer) Adds aBiFunctionto invoke the with theSdkLoggerProviderBuilderto allow customization.addLogRecordExporterCustomizer(BiFunction<? super LogRecordExporter, ConfigProperties, ? extends LogRecordExporter> logRecordExporterCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredLogRecordExporterto allow customization.addLogRecordProcessorCustomizer(BiFunction<? super LogRecordProcessor, ConfigProperties, ? extends LogRecordProcessor> logRecordProcessorCustomizer) Adds aBiFunctionto invoke for all autoconfiguredLogRecordProcessors.addMeterProviderCustomizer(BiFunction<SdkMeterProviderBuilder, ConfigProperties, SdkMeterProviderBuilder> meterProviderCustomizer) Adds aBiFunctionto invoke the with theSdkMeterProviderBuilderto allow customization.addMetricExporterCustomizer(BiFunction<? super MetricExporter, ConfigProperties, ? extends MetricExporter> metricExporterCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredSpanExporterto allow customization.addMetricReaderCustomizer(BiFunction<? super MetricReader, ConfigProperties, ? extends MetricReader> readerCustomizer) Adds aBiFunctionto invoke with the autoconfiguredMetricReaderto allow customization.addPropagatorCustomizer(BiFunction<? super TextMapPropagator, ConfigProperties, ? extends TextMapPropagator> propagatorCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredTextMapPropagatorto allow customization.addPropertiesCustomizer(Function<ConfigProperties, Map<String, String>> propertiesCustomizer) Adds aFunctionto invoke the with theConfigPropertiesto allow customization.addPropertiesSupplier(Supplier<Map<String, String>> propertiesSupplier) Adds aSupplierof a map of property names and values to use as defaults for theConfigPropertiesused during auto-configuration.addResourceCustomizer(BiFunction<? super Resource, ConfigProperties, ? extends Resource> resourceCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredResourceto allow customization.addSamplerCustomizer(BiFunction<? super Sampler, ConfigProperties, ? extends Sampler> samplerCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredSamplerto allow customization.addSpanExporterCustomizer(BiFunction<? super SpanExporter, ConfigProperties, ? extends SpanExporter> spanExporterCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredSpanExporterto allow customization.addSpanProcessorCustomizer(BiFunction<? super SpanProcessor, ConfigProperties, ? extends SpanProcessor> spanProcessorCustomizer) Adds aBiFunctionto invoke for all autoconfiguredSpanProcessor.addTracerProviderCustomizer(BiFunction<SdkTracerProviderBuilder, ConfigProperties, SdkTracerProviderBuilder> tracerProviderCustomizer) Adds aBiFunctionto invoke the with theSdkTracerProviderBuilderto allow customization.build()Returns a newAutoConfiguredOpenTelemetrySdkholding components auto-configured using the settings of thisAutoConfiguredOpenTelemetrySdkBuilder.Disable the registration of a shutdown hook to shut down the SDK when appropriate.Sets whether the configuredOpenTelemetrySdkshould be set as the application's global instance.setServiceClassLoader(ClassLoader serviceClassLoader) Sets theClassLoaderto be used to load SPI implementations.
-
Method Details
-
addTracerProviderCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addTracerProviderCustomizer(BiFunction<SdkTracerProviderBuilder, ConfigProperties, SdkTracerProviderBuilder> tracerProviderCustomizer) Adds aBiFunctionto invoke the with theSdkTracerProviderBuilderto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addTracerProviderCustomizerin interfaceAutoConfigurationCustomizer
-
addPropagatorCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addPropagatorCustomizer(BiFunction<? super TextMapPropagator, ConfigProperties, ? extends TextMapPropagator> propagatorCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredTextMapPropagatorto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addPropagatorCustomizerin interfaceAutoConfigurationCustomizer
-
addResourceCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addResourceCustomizer(BiFunction<? super Resource, ConfigProperties, ? extends Resource> resourceCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredResourceto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addResourceCustomizerin interfaceAutoConfigurationCustomizer
-
addSamplerCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addSamplerCustomizer(BiFunction<? super Sampler, ConfigProperties, ? extends Sampler> samplerCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredSamplerto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addSamplerCustomizerin interfaceAutoConfigurationCustomizer
-
addSpanExporterCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addSpanExporterCustomizer(BiFunction<? super SpanExporter, ConfigProperties, ? extends SpanExporter> spanExporterCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredSpanExporterto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addSpanExporterCustomizerin interfaceAutoConfigurationCustomizer
-
addSpanProcessorCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addSpanProcessorCustomizer(BiFunction<? super SpanProcessor, ConfigProperties, ? extends SpanProcessor> spanProcessorCustomizer) Adds aBiFunctionto invoke for all autoconfiguredSpanProcessor. The return value of theBiFunctionwill replace the passed-in argument. In contrast toaddSpanExporterCustomizer(BiFunction)this allows modifications to happen before batching occurs. As a result, it is possible to efficiently filter spans, add artificial spans or delay spans for enhancing them with external, delayed data.Multiple calls will execute the customizers in order.
- Specified by:
addSpanProcessorCustomizerin interfaceAutoConfigurationCustomizer
-
addPropertiesSupplier
public AutoConfiguredOpenTelemetrySdkBuilder addPropertiesSupplier(Supplier<Map<String, String>> propertiesSupplier) Adds aSupplierof a map of property names and values to use as defaults for theConfigPropertiesused during auto-configuration. The order of precedence of properties is system properties > environment variables > the suppliers registered with this method.Multiple calls will cause properties to be merged in order, with later ones overwriting duplicate keys in earlier ones.
- Specified by:
addPropertiesSupplierin interfaceAutoConfigurationCustomizer
-
addPropertiesCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addPropertiesCustomizer(Function<ConfigProperties, Map<String, String>> propertiesCustomizer) Adds aFunctionto invoke the with theConfigPropertiesto allow customization. The return value of theFunctionwill be merged into theConfigPropertiesbefore it is used for auto-configuration, overwriting the properties that are already there.Multiple calls will cause properties to be merged in order, with later ones overwriting duplicate keys in earlier ones.
- Specified by:
addPropertiesCustomizerin interfaceAutoConfigurationCustomizer
-
addMeterProviderCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addMeterProviderCustomizer(BiFunction<SdkMeterProviderBuilder, ConfigProperties, SdkMeterProviderBuilder> meterProviderCustomizer) Adds aBiFunctionto invoke the with theSdkMeterProviderBuilderto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addMeterProviderCustomizerin interfaceAutoConfigurationCustomizer
-
addMetricExporterCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addMetricExporterCustomizer(BiFunction<? super MetricExporter, ConfigProperties, ? extends MetricExporter> metricExporterCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredSpanExporterto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addMetricExporterCustomizerin interfaceAutoConfigurationCustomizer
-
addMetricReaderCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addMetricReaderCustomizer(BiFunction<? super MetricReader, ConfigProperties, ? extends MetricReader> readerCustomizer) Adds aBiFunctionto invoke with the autoconfiguredMetricReaderto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addMetricReaderCustomizerin interfaceAutoConfigurationCustomizer
-
addLoggerProviderCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addLoggerProviderCustomizer(BiFunction<SdkLoggerProviderBuilder, ConfigProperties, SdkLoggerProviderBuilder> loggerProviderCustomizer) Adds aBiFunctionto invoke the with theSdkLoggerProviderBuilderto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addLoggerProviderCustomizerin interfaceAutoConfigurationCustomizer
-
addLogRecordExporterCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addLogRecordExporterCustomizer(BiFunction<? super LogRecordExporter, ConfigProperties, ? extends LogRecordExporter> logRecordExporterCustomizer) Adds aBiFunctionto invoke with the default autoconfiguredLogRecordExporterto allow customization. The return value of theBiFunctionwill replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addLogRecordExporterCustomizerin interfaceAutoConfigurationCustomizer
-
addLogRecordProcessorCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addLogRecordProcessorCustomizer(BiFunction<? super LogRecordProcessor, ConfigProperties, ? extends LogRecordProcessor> logRecordProcessorCustomizer) Adds aBiFunctionto invoke for all autoconfiguredLogRecordProcessors. The return value of theBiFunctionwill replace the passed-in argument. In contrast toaddLogRecordExporterCustomizer(BiFunction)(BiFunction)} this allows modifications to happen before batching occurs. As a result, it is possible to efficiently filter logs, add artificial logs or delay logs for enhancing them with external, delayed data.Multiple calls will execute the customizers in order.
- Specified by:
addLogRecordProcessorCustomizerin interfaceAutoConfigurationCustomizer
-
disableShutdownHook
Disable the registration of a shutdown hook to shut down the SDK when appropriate. By default, the shutdown hook is registered.Skipping the registration of the shutdown hook may cause unexpected behavior. This configuration is for SDK consumers that require control over the SDK lifecycle. In this case, alternatives must be provided by the SDK consumer to shut down the SDK.
-
setResultAsGlobal
Sets whether the configuredOpenTelemetrySdkshould be set as the application's global instance.By default,
GlobalOpenTelemetryis not set. -
setServiceClassLoader
Sets theClassLoaderto be used to load SPI implementations. -
build
Returns a newAutoConfiguredOpenTelemetrySdkholding components auto-configured using the settings of thisAutoConfiguredOpenTelemetrySdkBuilder.
-