Class OtelRumConfig
-
- All Implemented Interfaces:
public final class OtelRumConfigConfiguration object for OpenTelemetry Android. The configuration items in this class will be used in the OpenTelemetryRumBuilder to wire up and enable/disable various mobile instrumentation components. Property reads are not threadsafe.
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleantracingEnabledprivate final BooleanloggingEnabledprivate final BooleanmetricsEnabled
-
Constructor Summary
Constructors Constructor Description OtelRumConfig()
-
Method Summary
Modifier and Type Method Description final BooleangetTracingEnabled()Whether the tracing API is enabled. final BooleangetLoggingEnabled()Whether the logging API is enabled. final BooleangetMetricsEnabled()Whether the metrics API is enabled. final OtelRumConfigsetGlobalAttributes(Attributes attributes)Configures the set of global attributes to emit with every span and event. final OtelRumConfigsetGlobalAttributes(Supplier<Attributes> globalAttributesSupplier)final BooleanhasGlobalAttributes()final Supplier<Attributes>getGlobalAttributesSupplier()final OtelRumConfigdisableNetworkAttributes()Disables the collection of runtime network attributes. final BooleanshouldIncludeNetworkAttributes()Returns true if runtime network attributes are enabled, false otherwise. final OtelRumConfigdisableSdkInitializationEvents()Disables the collection of events related to the initialization of the OTel Android SDK itself. final BooleanshouldGenerateSdkInitializationEvents()Returns true if the SDK is configured to generate initialization events, false otherwise. final OtelRumConfigdisableScreenAttributes()Call this to disable the collection of screen attributes. final BooleanshouldIncludeScreenAttributes()Return true if the SDK should be configured to report screen attributes. final BooleanshouldDiscoverInstrumentations()Return true if the RUM initialization should look for instrumentations in the classpath and apply them automatically. final OtelRumConfigdisableInstrumentationDiscovery()Call this to disable the automatic search for instrumentations in the classpath. final OtelRumConfigsuppressInstrumentation(String instrumentationName)Adds an instrumentation name to the list of suppressed instrumentations. final OtelRumConfigallowInstrumentation(String instrumentationName)Removes an instrumentation name from the list of suppressed instrumentations. final BooleanisSuppressed(String instrumentationName)Returns false when the given instrumentation has been suppressed. final OtelRumConfigsetTracingDisabled()Enables or disables the tracing API for the SDK. final OtelRumConfigsetLoggingDisabled()Enables or disables the logging API for the SDK. final OtelRumConfigsetMetricsDisabled()Enables or disables the metrics API for the SDK. final DiskBufferingConfiggetDiskBufferingConfig()final OtelRumConfigsetDiskBufferingConfig(DiskBufferingConfig diskBufferingConfig)Sets the parameters for caching signals in disk in order to export them later. -
-
Method Detail
-
getTracingEnabled
final Boolean getTracingEnabled()
Whether the tracing API is enabled. Toggle with using setTracingDisabled
-
getLoggingEnabled
final Boolean getLoggingEnabled()
Whether the logging API is enabled. Toggle with using setLoggingDisabled
-
getMetricsEnabled
final Boolean getMetricsEnabled()
Whether the metrics API is enabled. Toggle with using setMetricsDisabled
-
setGlobalAttributes
final OtelRumConfig setGlobalAttributes(Attributes attributes)
Configures the set of global attributes to emit with every span and event. Any existing configured attributes will be dropped. Default = none.
-
setGlobalAttributes
final OtelRumConfig setGlobalAttributes(Supplier<Attributes> globalAttributesSupplier)
-
hasGlobalAttributes
final Boolean hasGlobalAttributes()
-
getGlobalAttributesSupplier
final Supplier<Attributes> getGlobalAttributesSupplier()
-
disableNetworkAttributes
final OtelRumConfig disableNetworkAttributes()
Disables the collection of runtime network attributes. See CurrentNetworkProvider for more information. Default = true.
- Returns:
this
-
shouldIncludeNetworkAttributes
final Boolean shouldIncludeNetworkAttributes()
Returns true if runtime network attributes are enabled, false otherwise.
-
disableSdkInitializationEvents
final OtelRumConfig disableSdkInitializationEvents()
Disables the collection of events related to the initialization of the OTel Android SDK itself. Default = true.
- Returns:
this
-
shouldGenerateSdkInitializationEvents
final Boolean shouldGenerateSdkInitializationEvents()
Returns true if the SDK is configured to generate initialization events, false otherwise.
-
disableScreenAttributes
final OtelRumConfig disableScreenAttributes()
Call this to disable the collection of screen attributes. See [ ] for more information. Default = true.
- Returns:
this
-
shouldIncludeScreenAttributes
final Boolean shouldIncludeScreenAttributes()
Return true if the SDK should be configured to report screen attributes.
-
shouldDiscoverInstrumentations
final Boolean shouldDiscoverInstrumentations()
Return true if the RUM initialization should look for instrumentations in the classpath and apply them automatically.
-
disableInstrumentationDiscovery
final OtelRumConfig disableInstrumentationDiscovery()
Call this to disable the automatic search for instrumentations in the classpath.
- Returns:
this
-
suppressInstrumentation
final OtelRumConfig suppressInstrumentation(String instrumentationName)
Adds an instrumentation name to the list of suppressed instrumentations. Instrumentations that have been suppressed will not be installed at startup.
-
allowInstrumentation
final OtelRumConfig allowInstrumentation(String instrumentationName)
Removes an instrumentation name from the list of suppressed instrumentations. Instrumentations that have been suppressed will not be installed at startup.
-
isSuppressed
final Boolean isSuppressed(String instrumentationName)
Returns false when the given instrumentation has been suppressed. True otherwise.
-
setTracingDisabled
final OtelRumConfig setTracingDisabled()
Enables or disables the tracing API for the SDK. When disabled, the SDK will provide no-op implementations to instrumentation that use this API.
-
setLoggingDisabled
final OtelRumConfig setLoggingDisabled()
Enables or disables the logging API for the SDK. When disabled, the SDK will provide no-op implementations to instrumentation that use this API.
-
setMetricsDisabled
final OtelRumConfig setMetricsDisabled()
Enables or disables the metrics API for the SDK. When disabled, the SDK will provide no-op implementations to instrumentation that use this API.
-
getDiskBufferingConfig
final DiskBufferingConfig getDiskBufferingConfig()
-
setDiskBufferingConfig
final OtelRumConfig setDiskBufferingConfig(DiskBufferingConfig diskBufferingConfig)
Sets the parameters for caching signals in disk in order to export them later.
- Returns:
this
-
-
-
-