firebase / firebase-functions

Firebase SDK for Cloud Functions
https://firebase.google.com/docs/functions/
MIT License
1.01k stars 201 forks source link

Gen 2 onCall handlers don't have traces #1487

Closed ciriousjoker closed 7 months ago

ciriousjoker commented 7 months ago

Related issues

[REQUIRED] Version info

node: v16.19.0

firebase-functions: v4.5.0

firebase-tools: v12.7.0

firebase-admin: v11.11.0

[REQUIRED] Test case

import { onCall } from "firebase-functions/v2/https";

export const checkoutAddPaymentMethodPayPal = onCall(async (request) => {
  console.log("This should have a trace, but it does not.");
});

[REQUIRED] Steps to reproduce

  1. Deploy above code
  2. Check cloud function logs
  3. Try to view the logs from "same trace"

[REQUIRED] Expected behavior

Should have a trace.

[REQUIRED] Actual behavior

Doesn't, "same trace" is greyed out.

Were you able to successfully deploy your functions?

Yes, deployment works.


Related:

Reason for this is most likely, that unlike the onRequest function, the onCall handler isn't wrapped in wrapTraceContext().

google-oss-bot commented 7 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

joshgare commented 7 months ago

Seeing the same issue, making debugging on stackdriver much more troublesome than V1 functions.

blidd-google commented 7 months ago

Thanks for bringing this to our attention, PR is out that wraps onCall handlers with trace context.