ObservabilityOptions class

Configuration for the LaunchDarkly observability plugin. Field set mirrors LaunchDarkly.Observability.ObservabilityOptions in the .NET bridge.

This type is platform-agnostic on purpose: it carries no transport details (no pigeon wire types), so it can be passed to either the native (mobile) or web implementation. The native wire conversion lives in platform/io/native_options_codec.dart.

Constructors

ObservabilityOptions({bool isEnabled = true, String serviceName = defaultServiceName, String? serviceVersion, String? otlpEndpoint, String? backendUrl, String? contextFriendlyName, Map<String, Object?>? attributes, Map<String, String> customHeaders = const {}, Duration sessionBackgroundTimeout = const Duration(minutes: 15), ObservabilityLogLevel logsApiLevel = ObservabilityLogLevel.info, TracesOptions traces = const TracesOptions(), bool metricsEnabled = true, AnalyticsOptions analytics = const AnalyticsOptions(), InstrumentationOptions instrumentation = const InstrumentationOptions()})
Creates observability options. Every argument is optional; the defaults enable all telemetry and export to LaunchDarkly.
const

Properties

analytics → AnalyticsOptions
Analytics telemetry configuration. Mirrors Android ObservabilityOptions.analytics. See each AnalyticsOptions field for which platforms it applies to.
final
attributes → Map<String, Object?>?
Extra OTel Resource attributes attached to every exported signal on every platform, such as deployment.environment.
final
backendUrl → String
The LaunchDarkly observability backend used for session and replay metadata. Defaults to defaultBackendUrl.
final
contextFriendlyName → String?
A human-readable name for the current context, shown in the observability UI instead of its key.
final
customHeaders → Map<String, String>
Extra HTTP headers added to OTLP exports (e.g. for proxies or auth). Mirrors Android/iOS customHeaders. Native-only.
final
hashCode → int
The hash code for this object.
no setterinherited
instrumentation → InstrumentationOptions
Toggles for automatic instrumentation: launch times, crash reporting and debugPrint capture.
final
isEnabled → bool
Whether observability telemetry is recorded. Defaults to true.
final
logsApiLevel → ObservabilityLogLevel
Minimum severity of logs forwarded to the OpenTelemetry logs pipeline. Use ObservabilityLogLevel.none to disable logs. Mirrors Android/iOS logsApiLevel. Native-only. Defaults to ObservabilityLogLevel.info.
final
metricsEnabled → bool
Whether to export metrics. Mirrors Android metricsApi and iOS metricsApi. Native-only. Defaults to true.
final
otlpEndpoint → String
The OTLP/HTTP endpoint telemetry is exported to (without the /v1/... signal path). Defaults to defaultOtlpEndpoint; override it to send data through a proxy.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serviceName → String
The service.name resource attribute. Defaults to defaultServiceName, which names the SDK rather than your app — set it to identify your app.
final
serviceVersion → String?
The service.version resource attribute, such as a release version or Git SHA.
final
sessionBackgroundTimeout → Duration
How long the app may stay in the background before the current session is ended. Mirrors Android/iOS sessionBackgroundTimeout. Native-only. Defaults to 15 minutes.
final
traces → TracesOptions
Controls automatic trace generation. Mirrors Android tracesApi and iOS tracesApi. Native-only.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

defaultBackendUrl → const String
The LaunchDarkly observability backend used when no backendUrl is given.
defaultOtlpEndpoint → const String
The LaunchDarkly OTLP collector used when no otlpEndpoint is given.
defaultServiceName → const String
The serviceName used when none is given.