Class AutoConfiguredOpenTelemetrySdkBuilder
- All Implemented Interfaces:
io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
Method Summary
Modifier and TypeMethodDescriptionaddLogEmitterProviderCustomizer
(BiFunction<io.opentelemetry.sdk.logs.SdkLogEmitterProviderBuilder, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, io.opentelemetry.sdk.logs.SdkLogEmitterProviderBuilder> logEmitterProviderCustomizer) Adds aBiFunction
to invoke the with theSdkLogEmitterProviderBuilder
to allow customization.addLogExporterCustomizer
(BiFunction<? super io.opentelemetry.sdk.logs.export.LogExporter, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.logs.export.LogExporter> logExporterCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredLogExporter
to allow customization.addMeterProviderCustomizer
(BiFunction<io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder> meterProviderCustomizer) Adds aBiFunction
to invoke the with theSdkMeterProviderBuilder
to allow customization.addMetricExporterCustomizer
(BiFunction<? super io.opentelemetry.sdk.metrics.export.MetricExporter, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.metrics.export.MetricExporter> metricExporterCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredSpanExporter
to allow customization.addPropagatorCustomizer
(BiFunction<? super io.opentelemetry.context.propagation.TextMapPropagator, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.context.propagation.TextMapPropagator> propagatorCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredTextMapPropagator
to allow customization.addPropertiesCustomizer
(Function<io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, Map<String, String>> propertiesCustomizer) Adds aFunction
to invoke the with theConfigProperties
to allow customization.addPropertiesSupplier
(Supplier<Map<String, String>> propertiesSupplier) Adds aSupplier
of a map of property names and values to use as defaults for theConfigProperties
used during auto-configuration.addResourceCustomizer
(BiFunction<? super io.opentelemetry.sdk.resources.Resource, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.resources.Resource> resourceCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredResource
to allow customization.addSamplerCustomizer
(BiFunction<? super io.opentelemetry.sdk.trace.samplers.Sampler, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.trace.samplers.Sampler> samplerCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredSampler
to allow customization.addSpanExporterCustomizer
(BiFunction<? super io.opentelemetry.sdk.trace.export.SpanExporter, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.trace.export.SpanExporter> spanExporterCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredSpanExporter
to allow customization.addTracerProviderCustomizer
(BiFunction<io.opentelemetry.sdk.trace.SdkTracerProviderBuilder, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, io.opentelemetry.sdk.trace.SdkTracerProviderBuilder> tracerProviderCustomizer) Adds aBiFunction
to invoke the with theSdkTracerProviderBuilder
to allow customization.build()
Returns a newAutoConfiguredOpenTelemetrySdk
holding components auto-configured using the settings of thisAutoConfiguredOpenTelemetrySdkBuilder
.registerShutdownHook
(boolean registerShutdownHook) Control the registration of a shutdown hook to shut down the SDK when appropriate.setResultAsGlobal
(boolean setResultAsGlobal) Sets whether the configuredOpenTelemetrySdk
should be set as the application's global instance.setServiceClassLoader
(ClassLoader serviceClassLoader) Sets theClassLoader
to be used to load SPI implementations.
-
Method Details
-
addTracerProviderCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addTracerProviderCustomizer(BiFunction<io.opentelemetry.sdk.trace.SdkTracerProviderBuilder, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, io.opentelemetry.sdk.trace.SdkTracerProviderBuilder> tracerProviderCustomizer) Adds aBiFunction
to invoke the with theSdkTracerProviderBuilder
to allow customization. The return value of theBiFunction
will replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addTracerProviderCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addPropagatorCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addPropagatorCustomizer(BiFunction<? super io.opentelemetry.context.propagation.TextMapPropagator, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.context.propagation.TextMapPropagator> propagatorCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredTextMapPropagator
to allow customization. The return value of theBiFunction
will replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addPropagatorCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addResourceCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addResourceCustomizer(BiFunction<? super io.opentelemetry.sdk.resources.Resource, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.resources.Resource> resourceCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredResource
to allow customization. The return value of theBiFunction
will replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addResourceCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addSamplerCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addSamplerCustomizer(BiFunction<? super io.opentelemetry.sdk.trace.samplers.Sampler, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.trace.samplers.Sampler> samplerCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredSampler
to allow customization. The return value of theBiFunction
will replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addSamplerCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addSpanExporterCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addSpanExporterCustomizer(BiFunction<? super io.opentelemetry.sdk.trace.export.SpanExporter, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.trace.export.SpanExporter> spanExporterCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredSpanExporter
to allow customization. The return value of theBiFunction
will replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addSpanExporterCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addPropertiesSupplier
public AutoConfiguredOpenTelemetrySdkBuilder addPropertiesSupplier(Supplier<Map<String, String>> propertiesSupplier) Adds aSupplier
of a map of property names and values to use as defaults for theConfigProperties
used 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:
addPropertiesSupplier
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addPropertiesCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addPropertiesCustomizer(Function<io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, Map<String, String>> propertiesCustomizer) Adds aFunction
to invoke the with theConfigProperties
to allow customization. The return value of theFunction
will be merged into theConfigProperties
before 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:
addPropertiesCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addMeterProviderCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addMeterProviderCustomizer(BiFunction<io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder> meterProviderCustomizer) Adds aBiFunction
to invoke the with theSdkMeterProviderBuilder
to allow customization. The return value of theBiFunction
will replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addMeterProviderCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addMetricExporterCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addMetricExporterCustomizer(BiFunction<? super io.opentelemetry.sdk.metrics.export.MetricExporter, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.metrics.export.MetricExporter> metricExporterCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredSpanExporter
to allow customization. The return value of theBiFunction
will replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addMetricExporterCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addLogEmitterProviderCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addLogEmitterProviderCustomizer(BiFunction<io.opentelemetry.sdk.logs.SdkLogEmitterProviderBuilder, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, io.opentelemetry.sdk.logs.SdkLogEmitterProviderBuilder> logEmitterProviderCustomizer) Adds aBiFunction
to invoke the with theSdkLogEmitterProviderBuilder
to allow customization. The return value of theBiFunction
will replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addLogEmitterProviderCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
addLogExporterCustomizer
public AutoConfiguredOpenTelemetrySdkBuilder addLogExporterCustomizer(BiFunction<? super io.opentelemetry.sdk.logs.export.LogExporter, io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties, ? extends io.opentelemetry.sdk.logs.export.LogExporter> logExporterCustomizer) Adds aBiFunction
to invoke with the default autoconfiguredLogExporter
to allow customization. The return value of theBiFunction
will replace the passed-in argument.Multiple calls will execute the customizers in order.
- Specified by:
addLogExporterCustomizer
in interfaceio.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer
-
registerShutdownHook
Control 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.
- Parameters:
registerShutdownHook
- a booleantrue
will register the hook, otherwisefalse
will skip registration.
-
setResultAsGlobal
Sets whether the configuredOpenTelemetrySdk
should be set as the application's global instance. -
setServiceClassLoader
Sets theClassLoader
to be used to load SPI implementations. -
build
Returns a newAutoConfiguredOpenTelemetrySdk
holding components auto-configured using the settings of thisAutoConfiguredOpenTelemetrySdkBuilder
.
-