cloud-trace-nodejs: [Tracking Issue] Auto-tracing not working in Google Cloud Functions/Firebase Cloud Functions

When using @google-cloud/trace-agent in Firebase Cloud Functions, the custom tracing works, but auto tracing doesn’t (no trace for HTTP/HTTPS/gRPC requests).

Even included as the first module, the cloud functions log output:

ERROR:@google-cloud/trace-agent: TraceAgent#start: Tracing might not work as the following modules were loaded before the trace agent was initialized: [accepts, body-parser, bytes, content-disposition, content-type, cookie, cookie-signature, crc, debug, depd, destroy, ee-first, escape-html, etag, express, finalhandler, forwarded, fresh, iconv-lite, ipaddr.js, media-typer, merge-descriptors, methods, mime, mime-db, mime-types, ms, negotiator, on-finished, parseurl, path-to-regexp, proxy-addr, qs, range-parser, raw-body, send, serve-static, type-is, utils-merge, vary]

It may related to how Firebase Cloud Functions works as an overlay of Google Cloud Functions.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Hi (I am a Product Manager on Google Cloud). We are working to make it super easy to enable Stackdriver Trace for your functions with no setup required. You can sign up for the Alpha at https://goo.gl/forms/MtCO9Ehu3IfSsqiw2. I should send the first invites within a few weeks.

As others said, in the meantime, you should be able to import the trace module, but not everything will be traced as it is not the first module imported.

Hey @Elyx0, I saw that you also posted on https://issuetracker.google.com/124761993 – you should treat that as the source of truth. Thanks!