otel_firebase_analytics 0.2.0
otel_firebase_analytics: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:firebase_analytics`. Forwards Analytics events as OTel spans so analytics activity appears in your distributed traces.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.0 - 2026-08-09 #
Changed #
-
firebase_analyticsfloor raised to^12.0.0(latest major; verified against both12.0.0and the current12.4.x). -
All attribute keys are now typed constants:
enduser.idcomes from the registryEnduserenum,analytics.user_property.valuejoinedFirebaseAnalyticsSemantics, and theanalytics.parameters.fan-out prefix is the exportedanalyticsParametersPrefixconstant. No emitted keys changed. -
Semantic conventions updated to the current OTel registry: deprecated attribute keys are no longer emitted (
db.system->db.system.name,db.operation->db.operation.name,rpc.system->rpc.system.name, withrpc.servicefolded into a fully-qualifiedrpc.method). -
Dependency floors raised to
dartastic_opentelemetry ^1.1.0-beta.12anddartastic_opentelemetry_api ^1.0.0-rc.1. The previous floors declared compatibility with API versions that predate the semconv enums this package uses and could not actually resolve-and-compile. -
repositoryURL corrected to the canonicalDartasticorg casing so pub.dev repository verification succeeds.
Added #
example/example.md— end-to-end walkthrough (init, traced calls, resulting trace shape).- Extension methods on
FirebaseAnalytics:tracedLogEvent— emits a CLIENT span namedanalytics <event>withanalytics.system,analytics.event.name, and a flatanalytics.parameters.<key>for each entry in the supplied parameters map.tracedLogScreenView— emits a span namedanalytics screen_viewwithanalytics.screen.name/analytics.screen.classattributes.tracedSetUserId— emits a span and attaches the supplied UID asenduser.idso downstream traces show the user identity that was just set.tracedSetUserProperty— emits a span carryinganalytics.user_property.nameand.value.
tracedAnalyticsCall<R>({eventName, invoke, parameters, extraAttrs})— the generic helper underneath the extension methods. Useful when you can't or don't want to use a realFirebaseAnalytics(testing, custom backends).runWithoutFirebaseAnalyticsInstrumentation/runWithoutFirebaseAnalyticsInstrumentationAsync— zone-scoped suppression helpers.FirebaseAnalyticsSemantics— typed attribute-key enum for theanalytics.*keys.- Tests cover the full span shape (system + event + flat parameters with type coercion), extraAttrs without prefix, null-value skipping, exception path, suppression scope, and parent-span inheritance.