otel_cloud_firestore library

OpenTelemetry instrumentation for package:cloud_firestore.

Adds tracedGet, tracedSet, tracedAdd, tracedUpdate, tracedDelete, and tracedSnapshots as extension methods on the standard Firestore types, plus top-level tracedFirestoreTransaction and tracedFirestoreBatchCommit.

Enums

FirestoreSemantics
Cloud Firestore-specific attribute keys.

Extensions

OTelCollectionReference on CollectionReference<T>
Traced add on a CollectionReference. Other inherited methods come from the OTelQuery extension.
OTelDocumentReference on DocumentReference<T>
Traced operations on a DocumentReference.
OTelQuery on Query<T>
Traced operations on a Query (including CollectionReference, which extends it).

Functions

firestoreInstrumentationSuppressed() → bool
Returns true when the current zone has opted out of Firestore OTel instrumentation. The traced extension methods consult this before opening a span.
runWithoutFirestoreInstrumentation<T>(T body()) → T
Runs body in a zone where the traced extension methods become transparent passthroughs.
runWithoutFirestoreInstrumentationAsync<T>(Future<T> body()) → Future<T>
Async variant of runWithoutFirestoreInstrumentation. Both forms are safe to nest; they no-op once already inside a suppressed zone.
tracedFirestoreBatchCommit(WriteBatch batch, {int? size}) → Future<void>
Traced wrapper for WriteBatch.commit. The span carries db.firestore.batch.size when size is supplied.
tracedFirestoreTransaction<R>(FirebaseFirestore db, TransactionHandler<R> handler, {Duration timeout = const Duration(seconds: 30), int maxAttempts = 5}) → Future<R>
Traced wrapper for FirebaseFirestore.runTransaction.