0

I have many v1 cloud functions. Written in typescript and running on NodeJS 18. Deployed with "firebase deploy functions". Completely server-less.

If I open Cloud Trace ( https://console.cloud.google.com/traces ), I find all my functions, but there are no traces, just one single long bar (yes of course, I am not collecting them...)

no traces

Now, my question is, can I add tracing mechanism to my functions so to see detailed traces? How would I go about that?

I found this guide, https://cloud.google.com/trace/docs/setup/nodejs-ot but it is either for Compute Engine or Google Kubernetes Engine. And Firebase Functions are neither of these...

Also, I know that sometimes the function instance is disposed, some other time no, like google try to reuse resources (indeed the second call to one of my function, within a 1 minute, is waaaaaaaay faster than the initial call). In that case, wouldn't this "recycling" be an issue for the sake of traces?


Edit: what I did (thanks to Doug for your comment).

I haven't set up anything at all for tracing, my question is to know if it is possible and how to do it. The only documentation I found, as said before is ( https://cloud.google.com/trace/docs/setup/nodejs-ot ) and to me it seems that said doc does not apply to my case (I am not on Compute Engine nor on Google Kubernetes Engine) I have searched also for the documentation mentioned by Doug https://cloud.google.com/trace but I could not find a practical step by step implementation guide.

So If you want to reproduce my behaviour

  1. firebase init a project
  2. then write a function definition
  3. deploy it with firebase deploy --only functions
  4. go to trace on google cloud platform: https://console.cloud.google.com/traces
  5. observe that the function has much as it is complex, calls different subfunctions, and makes multiple other http requests etc. has no detailed trace, and just one single span as depicted in the picture above
scugn1zz0
  • 301
  • 1
  • 6
  • 15
  • The documentation says: "All Cloud Run, Cloud Functions and App Engine standard applications are automatically traced and libraries are available to trace applications running elsewhere after minimal setup". Did you follow the instructions in the docs? If so, please edit the question to explain exactly what you did so we can see if you're doing it correctly. There should be enough information in your question that anyone can follow to reproduce and observe the same behavior. – Doug Stevenson Feb 19 '23 at 23:46
  • @doug-stevenson Thanks for your comment. I added the missing information. I have not done anything at all, as I do not know how to do and was not able to find the documentation that is appropriate for my case. Thanks! – scugn1zz0 Feb 20 '23 at 18:23

0 Answers0