Monitoring applications

Stackdriver can monitor standalone applications by capturing metrics and logs. It has support for major platforms and libraries, so our technology choices should not be a concern. In this case, we are going to create a Node.js application for several reasons:

  • It is easy to understand
  • The official examples are well documented for the Node.js version
  • Node.js is increasingly becoming a big platform for enterprise and startups

The first thing we need to do is write a small Node.js application. Create a new folder and execute this command:

npm init

Follow the instructions on the screen and you should now have package.json in the folder that you just created. Now it is time to install the dependencies:

npm install --save ...

Get Implementing Modern DevOps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.