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
addon aCollectionReference. 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(includingCollectionReference, which extends it).
Functions
-
firestoreInstrumentationSuppressed(
) → bool -
Returns
truewhen 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
bodyin 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 carriesdb.firestore.batch.sizewhensizeis supplied. -
tracedFirestoreTransaction<
R> (FirebaseFirestore db, TransactionHandler< R> handler, {Duration timeout = const Duration(seconds: 30), int maxAttempts = 5}) → Future<R> -
Traced wrapper for
FirebaseFirestore.runTransaction.