Class OpenTelemetryRumBuilder
-
- All Implemented Interfaces:
public final class OpenTelemetryRumBuilderA builder of OpenTelemetryRum. It enabled configuring the OpenTelemetry SDK and disabling built-in Android instrumentations.
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 Modifier and Type Class Description public classOpenTelemetryRumBuilder.Companion
-
Field Summary
Fields Modifier and Type Field Description private final AndroidInstrumentationLoaderinstrumentationLoaderpublic final static OpenTelemetryRumBuilder.CompanionCompanion
-
Method Summary
Modifier and Type Method Description final AndroidInstrumentationLoadergetInstrumentationLoader()final OpenTelemetryRumBuildersetResource(Resource resource)Assign a Resource to be attached to all telemetry emitted by the OpenTelemetryRum created by this builder. final OpenTelemetryRumBuildermergeResource(Resource resource)Merges a new Resource with any existing Resource in this builder. final OpenTelemetryRumBuilderaddTracerProviderCustomizer(BiFunction<SdkTracerProviderBuilder, Context, SdkTracerProviderBuilder> customizer)Adds a BiFunction to invoke the with the SdkTracerProviderBuilder to allow customization. final OpenTelemetryRumBuilderaddMeterProviderCustomizer(BiFunction<SdkMeterProviderBuilder, Context, SdkMeterProviderBuilder> customizer)Adds a BiFunction to invoke the with the SdkMeterProviderBuilder to allow customization. final OpenTelemetryRumBuilderaddLoggerProviderCustomizer(BiFunction<SdkLoggerProviderBuilder, Context, SdkLoggerProviderBuilder> customizer)Adds a BiFunction to invoke the with the SdkLoggerProviderBuilder to allow customization. final OpenTelemetryRumBuilderaddInstrumentation(AndroidInstrumentation instrumentation)Adds an instrumentation to be applied as a part of the . final OpenTelemetryRumBuilderaddPropagatorCustomizer(Function<in TextMapPropagator, out TextMapPropagator> propagatorCustomizer)Adds a Function to invoke with the default TextMapPropagator to allow customization. final OpenTelemetryRumBuilderaddSpanExporterCustomizer(Function<in SpanExporter, out SpanExporter> spanExporterCustomizer)Adds a Function to invoke with the default SpanExporter to allow customization. final OpenTelemetryRumBuilderaddMetricExporterCustomizer(Function<in MetricExporter, out MetricExporter> metricExporterCustomizer)Adds a Function to invoke with the default MetricExporter to allow customization. final OpenTelemetryRumBuilderaddLogRecordExporterCustomizer(Function<in LogRecordExporter, out LogRecordExporter> logRecordExporterCustomizer)Adds a Function to invoke with the default LogRecordExporter to allow customization. final OpenTelemetryRumBuildersetSessionProvider(SessionProvider sessionProvider)Sets a custom SessionProvider that controls the session ID. final OpenTelemetryRumBuildersetExportScheduleEnablement(ScheduleEnablement exportScheduleEnablement)Sets a scheduler that will take care of periodically read data stored in disk and export it. final OpenTelemetryRumBuilderaddOtelReadyListener(Function1<OpenTelemetry, Unit> callback)Adds a callback to be invoked after the OpenTelemetry instance has been initialized. final OpenTelemetryRumBuildersetClock(Clock clock)Sets a custom Clock implementation. final OpenTelemetryRumbuild()Creates a new instance of OpenTelemetryRum with the settings of this OpenTelemetryRum. -
-
Method Detail
-
getInstrumentationLoader
final AndroidInstrumentationLoader getInstrumentationLoader()
-
setResource
final OpenTelemetryRumBuilder setResource(Resource resource)
Assign a Resource to be attached to all telemetry emitted by the OpenTelemetryRum created by this builder. This replaces any existing resource.
-
mergeResource
final OpenTelemetryRumBuilder mergeResource(Resource resource)
Merges a new Resource with any existing Resource in this builder. The resulting Resource will be attached to all telemetry emitted by the OpenTelemetryRum created by this builder.
-
addTracerProviderCustomizer
final OpenTelemetryRumBuilder addTracerProviderCustomizer(BiFunction<SdkTracerProviderBuilder, Context, SdkTracerProviderBuilder> customizer)
Adds a BiFunction to invoke the with the SdkTracerProviderBuilder to allow customization. The return value of the BiFunction will replace the passed-in argument.
Multiple calls will execute the customizers in order.
Note: calling SdkTracerProviderBuilder.setResource inside of your configuration function will cause any resource customizers to be ignored that were configured via .setResource.
-
addMeterProviderCustomizer
final OpenTelemetryRumBuilder addMeterProviderCustomizer(BiFunction<SdkMeterProviderBuilder, Context, SdkMeterProviderBuilder> customizer)
Adds a BiFunction to invoke the with the SdkMeterProviderBuilder to allow customization. The return value of the BiFunction will replace the passed-in argument.
Multiple calls will execute the customizers in order.
Note: calling SdkMeterProviderBuilder.setResource inside of your configuration function will cause any resource customizers to be ignored that were configured via .setResource.
-
addLoggerProviderCustomizer
final OpenTelemetryRumBuilder addLoggerProviderCustomizer(BiFunction<SdkLoggerProviderBuilder, Context, SdkLoggerProviderBuilder> customizer)
Adds a BiFunction to invoke the with the SdkLoggerProviderBuilder to allow customization. The return value of the BiFunction will replace the passed-in argument.
Multiple calls will execute the customizers in order.
Note: calling SdkLoggerProviderBuilder.setResource inside of your configuration function will cause any resource customizers to be ignored that were configured via .setResource.
-
addInstrumentation
final OpenTelemetryRumBuilder addInstrumentation(AndroidInstrumentation instrumentation)
Adds an instrumentation to be applied as a part of the .build method call.
-
addPropagatorCustomizer
final OpenTelemetryRumBuilder addPropagatorCustomizer(Function<in TextMapPropagator, out TextMapPropagator> propagatorCustomizer)
Adds a Function to invoke with the default TextMapPropagator to allow customization. The return value of the BiFunction will replace the passed-in argument. To add new propagators, use
TextMapPropagator.composite()with the existing propagator passed to your function.Multiple calls will execute the customizers in order.
-
addSpanExporterCustomizer
final OpenTelemetryRumBuilder addSpanExporterCustomizer(Function<in SpanExporter, out SpanExporter> spanExporterCustomizer)
Adds a Function to invoke with the default SpanExporter to allow customization. The return value of the Function will replace the passed-in argument.
Multiple calls will execute the customizers in order.
-
addMetricExporterCustomizer
final OpenTelemetryRumBuilder addMetricExporterCustomizer(Function<in MetricExporter, out MetricExporter> metricExporterCustomizer)
Adds a Function to invoke with the default MetricExporter to allow customization. The return value of the Function will replace the passed-in argument.
Multiple calls will execute the customizers in order.
-
addLogRecordExporterCustomizer
final OpenTelemetryRumBuilder addLogRecordExporterCustomizer(Function<in LogRecordExporter, out LogRecordExporter> logRecordExporterCustomizer)
Adds a Function to invoke with the default LogRecordExporter to allow customization. The return value of the Function will replace the passed-in argument.
Multiple calls will execute the customizers in order.
-
setSessionProvider
final OpenTelemetryRumBuilder setSessionProvider(SessionProvider sessionProvider)
Sets a custom SessionProvider that controls the session ID.
-
setExportScheduleEnablement
final OpenTelemetryRumBuilder setExportScheduleEnablement(ScheduleEnablement exportScheduleEnablement)
Sets a scheduler that will take care of periodically read data stored in disk and export it. If not specified, the default schedule exporter will be used.
-
addOtelReadyListener
final OpenTelemetryRumBuilder addOtelReadyListener(Function1<OpenTelemetry, Unit> callback)
Adds a callback to be invoked after the OpenTelemetry instance has been initialized. This can be used to defer some early lifecycle functionality until the OpenTelemetry instance is ready.
- Parameters:
callback-A callback that receives the OpenTelemetry instance.
- Returns:
this
-
setClock
final OpenTelemetryRumBuilder setClock(Clock clock)
Sets a custom Clock implementation.
-
-
-
-