Skip to content

Commit 41d616f

Browse files
authored
Wrap v2 firestore functions with trace context (#1440)
* Wrap v2 firestore functions with trace context * Add changelog
1 parent ba368e8 commit 41d616f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
- Add features to task queue functions. (#1423)
2+
- Add traces to V2 Firestore trigger logs. (#1440)

src/v2/providers/firestore.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
createSnapshotFromJson,
3535
createSnapshotFromProtobuf,
3636
} from "../../common/providers/firestore";
37+
import { wrapTraceContext } from "../trace";
3738

3839
export { Change };
3940

@@ -445,7 +446,7 @@ export function onOperation<Document extends string>(
445446
const event = raw as RawFirestoreEvent;
446447
const params = makeParams(event.document, documentPattern) as unknown as ParamsOf<Document>;
447448
const firestoreEvent = makeFirestoreEvent(eventType, event, params);
448-
return handler(firestoreEvent);
449+
return wrapTraceContext(handler)(firestoreEvent);
449450
};
450451

451452
func.run = handler;

0 commit comments

Comments
 (0)