From 714aa666549649baa5d549b6d9e86e223239efd4 Mon Sep 17 00:00:00 2001 From: Milo Hill Date: Tue, 11 Jul 2023 21:12:07 +0100 Subject: [PATCH 1/2] Wrap v2 firestore functions with trace context --- src/v2/providers/firestore.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/v2/providers/firestore.ts b/src/v2/providers/firestore.ts index 03a910d3d..619e089e3 100644 --- a/src/v2/providers/firestore.ts +++ b/src/v2/providers/firestore.ts @@ -34,6 +34,7 @@ import { createSnapshotFromJson, createSnapshotFromProtobuf, } from "../../common/providers/firestore"; +import { wrapTraceContext } from "../trace"; export { Change }; @@ -445,7 +446,7 @@ export function onOperation( const event = raw as RawFirestoreEvent; const params = makeParams(event.document, documentPattern) as unknown as ParamsOf; const firestoreEvent = makeFirestoreEvent(eventType, event, params); - return handler(firestoreEvent); + return wrapTraceContext(handler)(firestoreEvent); }; func.run = handler; From 10cc2263a647d44164e1298ba1b1b14cb4ab163c Mon Sep 17 00:00:00 2001 From: Milo Hill Date: Tue, 11 Jul 2023 22:12:16 +0100 Subject: [PATCH 2/2] Add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14d4358cc..f96d0b994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,2 @@ - Add features to task queue functions. (#1423) +- Add traces to V2 Firestore trigger logs. (#1440)