otel_firebase_auth 0.2.0
otel_firebase_auth: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:firebase_auth`. Extension methods on FirebaseAuth that wrap signIn/signOut/createUser calls with `auth.*` and `enduser.*` semconv spans.
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 #
- Semantic conventions aligned with the current OTel registry:
enduser.idanderror.typecome from the API's semconv enums; the not-yet-registeredauth.*keys live in the typedFirebaseAuthSemanticsenum (no raw string keys emitted). - 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.firebase_authfloor raised to^6.0.0(latest major;firebase_auth_mocksto^0.15.0to match). Analyzer and the full test suite verified at both the6.0.0lower bound and the current6.5.7.
Added #
- Extension methods on
FirebaseAuth:tracedSignInWithEmailAndPassword,tracedCreateUserWithEmailAndPassword,tracedSignInAnonymously,tracedSignInWithCustomToken,tracedSignInWithCredential,tracedSignOut,tracedSendPasswordResetEmail. Each opens aCLIENTspan namedfirebase_auth <op>withauth.system=firebase,auth.operation, and (when known)auth.provider. - On successful sign-in, the resulting user UID is attached as
enduser.idper OTel semconv. Each call acceptsrecordUserId: falseto skip that if UIDs are treated as PII in your environment. FirebaseAuthException-aware error handling:error.typeis set to thecodefield (e.g.wrong-password,user-not-found) instead of the runtime class name, and the exception'smessagebecomes the span status description. Generic exceptions fall back to runtime-classerror.type.runWithoutFirebaseAuthInstrumentation/runWithoutFirebaseAuthInstrumentationAsync— zone-scoped suppression helpers, matchingotel_grpc,otel_http,otel_web_socket_channel, andotel_cloud_firestore.FirebaseAuthSemantics— typed attribute-key enum holdingauth.system,auth.operation,auth.provideruntil upstream semconv covers identity operations natively.- Tests use
firebase_auth_mocks; no live Firebase required. Coverage: email/password sign-in (with UID capture and the opt-out), anonymous sign-in, sign-out, FirebaseAuthException error path, suppression scope.