Class OpenTelemetryRumBuilder

  • All Implemented Interfaces:

    
    public final class OpenTelemetryRumBuilder
    
                        

    A 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.

    • Constructor Detail

    • Method Detail

      • 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.

      • 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.

      • 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.

      • 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

      • build

         final OpenTelemetryRum build()

        Creates a new instance of OpenTelemetryRum with the settings of this OpenTelemetryRum.

        This method will initialize the OpenTelemetry SDK and install built-in system instrumentations in the passed Android Context.

        Returns:

        A new OpenTelemetryRum instance.