otel_cloud_firestore 0.2.0
otel_cloud_firestore: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:cloud_firestore`. Extensions on DocumentReference, CollectionReference and Query wrap reads, writes and listens in `db.*` 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-08 #
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). - 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. cloud_firestoreraised to^6.0.0(current major);fake_cloud_firestoredev dependency to^4.0.0to match.repositoryURL corrected to the canonicalDartasticorg casing so pub.dev repository verification succeeds.
Added #
- Extension methods on
DocumentReference:tracedGet,tracedSet,tracedUpdate,tracedDelete,tracedSnapshots. Each opens aCLIENTspan namedfirestore <op> <collection>/<doc>withdb.system.name=firestoreanddb.firestore.collection/db.firestore.documentattributes. - Extension method on
CollectionReference:tracedAdd. - Extension methods on
Query:tracedGet,tracedSnapshots.tracedGetaddsdb.response.returned_rowsfor the snapshot size. - Top-level
tracedFirestoreTransaction— wrapsFirebaseFirestore.runTransactionwith an attempt counter surfaced asdb.firestore.transaction.attempt. - Top-level
tracedFirestoreBatchCommit— wrapsWriteBatch.commitand recordsdb.firestore.batch.sizewhen supplied. runWithoutFirestoreInstrumentation/runWithoutFirestoreInstrumentationAsync— zone-scoped suppression helpers, mirroring the pattern used byotel_grpc,otel_http, andotel_web_socket_channel. Preemptive: Firestore is a plausible (if unconventional) log sink in some deployments.FirestoreSemantics— typed attribute-key enum holding the Firestore-specificdb.firestore.*keys until the upstream semconvDatabaseenum picks them up.- Tests use
fake_cloud_firestore; no live Firebase required. Coverage: doc set+get, collection add, query get with returned_rows, update + delete, exception path, suppression scope, transaction (with attempt counter), batch commit (with size).