v0.10.0
Faro Flutter SDK v0.10.0
✨ Added
-
Session sampling support: New
samplingconfiguration option allows controlling what percentage of sessions send telemetry data. This enables cost management and traffic reduction for high-volume applications. (Resolves #89)- Use
SamplingRate(0.5)for fixed 50% sampling - Use
SamplingFunction((context) => ...)for dynamic sampling based on session context (user attributes, app environment, etc.) - If not provided, all sessions are sampled (100%)
- Sampling decision is made once per session at initialization and applies to all telemetry types (events, logs, exceptions, measurements, traces)
- Example:
sampling: SamplingFunction((context) => context.meta.user?.attributes?['role'] == 'beta' ? 1.0 : 0.1) - Aligns with Faro Web SDK sampling behavior
- Use
-
ContextScope for span context lifetime control: New
contextScopeparameter onstartSpan()controls how long a span remains active in zone context for auto-assignment.ContextScope.callback(default) deactivates the span when the callback completes, preventing timer/stream callbacks from inheriting it.ContextScope.zonekeeps the span active for the entire zone lifetime, useful when you want timer callbacks to be children of the parent span. (Resolves #105) -
Span.noParent sentinel: New
Span.noParentstatic constant allows explicitly starting a span with no parent, ignoring the active span in zone context. Useful for timer callbacks or event-driven scenarios where you want to start a fresh, independent trace. (Resolves #105)
🔧 Fixed
- SDK-internal span attributes now use typed values: HTTP span attributes (
http.status_code,http.request_size,http.response_size) are now sent as integers instead of strings, enabling proper numeric queries in Tempo (e.g.,status_code > 400). - Session attributes support typed values:
sessionAttributesconfig now acceptsMap<String, Object>allowing typed custom attributes. Thedevice_is_physicalattribute is now sent as a boolean instead of a string. (Resolves #133)
See CHANGELOG.md for complete details.
Full Changelog: v0.9.0...v0.10.0