Announcing Stackdriver Debugger for Node.js
Product Manager, Google Cloud Platform
We’ve all been there. The code looked fine on your machine, but now you’re in production and it’s suddenly not working.
Stackdriver Debugger lets you inspect the state of an application at any code location without using logging statements and without stopping or slowing down your applications. This means users are not impacted during debugging. Using the production debugger, you can capture the local variables and call stack and link it back to a specific line location in your source code. You can use this to analyze your applications’ production state and understand your code’s behavior in production.
Setting up Stackdriver Debugger for Node.js
To get started, first install the @google-cloud/debug-agent npm module in your application:
Then, require debugger in the entry point of your application:
Now deploy your application! You’ll need to associate your sources with the application running in production, and you can do this via Cloud Source Repositories, GitHub or by copying sources directly from your desktop.
The passive debugger is just one of the ways you can diagnose issues with your app. You can also add log statements in real time — without needing to re-deploy your application. These are called Stackdriver Debugger Logpoints.
Logpoints let you inject log statements in real time, in your production application, without redeploying your application.
These are just a few of ways you can use Stackdriver Debugger for Node.js in your application. To get started, check out the full setup guide.