-
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.
-
-
Field Summary
Fields Modifier and Type Field Description private final SessionIdsessionIdprivate Resourceresourceprivate CurrentNetworkProvidercurrentNetworkProvider
-
Method Summary
Modifier and Type Method Description SessionIdgetSessionId()OpenTelemetryRumBuildersetResource(Resource resource)Assign a Resource to be attached to all telemetry emitted by the created by this builder. OpenTelemetryRumBuildersetCurrentNetworkProvider(CurrentNetworkProvider currentNetworkProvider)Call this to pass an existing CurrentNetworkProvider instance to share with the underlyingOpenTelemetry Rum instrumentation. OpenTelemetryRumBuildermergeResource(Resource resource)Merges a new Resource with any existing Resource in this builder. OpenTelemetryRumBuilderaddTracerProviderCustomizer(BiFunction<SdkTracerProviderBuilder, Application, SdkTracerProviderBuilder> customizer)Adds a BiFunction to invoke the with the SdkTracerProviderBuilder to allowcustomization. OpenTelemetryRumBuilderaddAnrCustomization(Consumer<AnrDetectorBuilder> customizer)Pass a Consumer that will receive the AnrDetectorBuilder in order to perform additionalspecific customizations. OpenTelemetryRumBuilderaddCrashReportingCustomization(Consumer<CrashReporterBuilder> customizer)Pass a Consumer that will receive the CrashReporterBuilder in order to perform additionalspecific customizations. OpenTelemetryRumBuilderaddMeterProviderCustomizer(BiFunction<SdkMeterProviderBuilder, Application, SdkMeterProviderBuilder> customizer)Adds a BiFunction to invoke the with the SdkMeterProviderBuilder to allowcustomization. OpenTelemetryRumBuilderaddLoggerProviderCustomizer(BiFunction<SdkLoggerProviderBuilder, Application, SdkLoggerProviderBuilder> customizer)Adds a BiFunction to invoke the with the SdkLoggerProviderBuilder to allowcustomization. OpenTelemetryRumBuilderaddInstrumentation(Consumer<InstrumentedApplication> instrumentationInstaller)Adds an instrumentation installer function that will be run on an instance as a part of the build method call. OpenTelemetryRumBuilderaddPropagatorCustomizer(Function<out Object, out TextMapPropagator> propagatorCustomizer)Adds a Function to invoke with the default TextMapPropagator to allowcustomization. OpenTelemetryRumBuilderaddSpanExporterCustomizer(Function<out Object, out SpanExporter> spanExporterCustomizer)Adds a Function to invoke with the default SpanExporter to allowcustomization. OpenTelemetryRumbuild()Creates a new instance of OpenTelemetryRum with the settings of this . -
-
Method Detail
-
getSessionId
SessionId getSessionId()
-
setResource
OpenTelemetryRumBuilder setResource(Resource resource)
Assign a Resource to be attached to all telemetry emitted by the created by this builder. This replaces any existing resource.
-
setCurrentNetworkProvider
OpenTelemetryRumBuilder setCurrentNetworkProvider(CurrentNetworkProvider currentNetworkProvider)
Call this to pass an existing CurrentNetworkProvider instance to share with the underlyingOpenTelemetry Rum instrumentation.
-
mergeResource
OpenTelemetryRumBuilder mergeResource(Resource resource)
Merges a new Resource with any existing Resource in this builder. Theresulting Resource will be attached to all telemetry emitted by the created by this builder.
-
addTracerProviderCustomizer
OpenTelemetryRumBuilder addTracerProviderCustomizer(BiFunction<SdkTracerProviderBuilder, Application, SdkTracerProviderBuilder> customizer)
Adds a BiFunction to invoke the with the SdkTracerProviderBuilder to allowcustomization. The return value of the BiFunction will replace the passed-inargument.
Multiple calls will execute the customizers in order.
Note: calling setResource inside of yourconfiguration function will cause any resource customizers to be ignored that were configuredvia setResource.
-
addAnrCustomization
OpenTelemetryRumBuilder addAnrCustomization(Consumer<AnrDetectorBuilder> customizer)
Pass a Consumer that will receive the AnrDetectorBuilder in order to perform additionalspecific customizations. If ANR detection is disabled, this method is effectively a no-op.
- Parameters:
customizer- A Consumer that will receive the AnrDetectorBuilder before theAnrDetector is built.
-
addCrashReportingCustomization
OpenTelemetryRumBuilder addCrashReportingCustomization(Consumer<CrashReporterBuilder> customizer)
Pass a Consumer that will receive the CrashReporterBuilder in order to perform additionalspecific customizations. If crash reporting is disabled via config, this method iseffectively a no-op.
- Parameters:
customizer- A Consumer that will recieve the CrashReporterBuilder before theCrashReporter is built.
-
addMeterProviderCustomizer
OpenTelemetryRumBuilder addMeterProviderCustomizer(BiFunction<SdkMeterProviderBuilder, Application, SdkMeterProviderBuilder> customizer)
Adds a BiFunction to invoke the with the SdkMeterProviderBuilder to allowcustomization. The return value of the BiFunction will replace the passed-inargument.
Multiple calls will execute the customizers in order.
Note: calling setResource inside of yourconfiguration function will cause any resource customizers to be ignored that were configuredvia setResource.
-
addLoggerProviderCustomizer
OpenTelemetryRumBuilder addLoggerProviderCustomizer(BiFunction<SdkLoggerProviderBuilder, Application, SdkLoggerProviderBuilder> customizer)
Adds a BiFunction to invoke the with the SdkLoggerProviderBuilder to allowcustomization. The return value of the BiFunction will replace the passed-inargument.
Multiple calls will execute the customizers in order.
Note: calling setResource inside of yourconfiguration function will cause any resource customizers to be ignored that were configuredvia setResource.
-
addInstrumentation
OpenTelemetryRumBuilder addInstrumentation(Consumer<InstrumentedApplication> instrumentationInstaller)
Adds an instrumentation installer function that will be run on an instance as a part of the build method call.
-
addPropagatorCustomizer
OpenTelemetryRumBuilder addPropagatorCustomizer(Function<out Object, out TextMapPropagator> propagatorCustomizer)
Adds a Function to invoke with the default TextMapPropagator to allowcustomization. The return value of the BiFunction will replace the passed-inargument. To add new propagators, use
{@code TextMapPropagator.composite()}with the existingpropagator passed to your function.Multiple calls will execute the customizers in order.
-
addSpanExporterCustomizer
OpenTelemetryRumBuilder addSpanExporterCustomizer(Function<out Object, out SpanExporter> spanExporterCustomizer)
-
build
OpenTelemetryRum build()
Creates a new instance of OpenTelemetryRum with the settings of this .
This method will initialize the OpenTelemetry SDK and install built-in systeminstrumentations in the passed Android Application.
-
-
-
-