Debugging Cloud Functions

You can inspect the runtime state of your functions using the Stackdriver Debugger agent for Node.js.

From your functions directory, add the dependency:

npm install --save @google-cloud/debug-agent

Then start the agent at the top of your functions/index.js:

require('@google-cloud/debug-agent').start({ allowExpressions: true });

Deploy your application, and navigate to the Stackdriver Debug view within the Google Cloud Console to set snapshots and start debugging. To learn more, review the README for the Stackdriver Debugger.

Stackdriver does not have access to the source code of your Cloud Functions by default. You'll need to host your code on Github, Bitbucket, or a Google Cloud Source Repository.

Send feedback about...

Need help? Visit our support page.