Strackdriver Monitoring provides dashboards and alerts for your cloud-powered applications. You configure Stackdriver Monitoring using the Stackdriver Monitoring Console. Review performance metrics for cloud services, virtual machines, and common open source servers such as MongoDB, Apache, Nginx, Elasticsearch, and more.
In this codelab, you'll learn the basics of Stackdriver Monitoring, how to navigate the Monitoring console, and where to look for basic monitoring events and statistics.
If you don't already have a Google Account (Gmail or G Suite), you must create one. Sign-in to Google Cloud Platform console (console.cloud.google.com) and create a new project from the Manage resources page :
Remember the project ID, a unique name across all Google Cloud projects (the name above has already been taken and will not work for you, sorry!). It will be referred to later in this codelab as
Next, you'll need to enable billing in the Developers Console in order to use Google Cloud resources.
Running through this codelab shouldn't cost you more than a few dollars, but it could be more if you decide to use more resources or if you leave them running (see "cleanup" section at the end of this document). The Google Cloud Platform pricing calculator is available here.
New users of Google Cloud Platform are eligible for a $300 free trial.
Before we can enable monitoring, we will need some kind of infrastructure within this Google Cloud Platform project to actually monitor, so let us create that now.
We will create:
To create the virtual machine:
To create the Cloud SQL instance:
We now have some resources that we can monitor!
Before we can use Stackdriver Monitoring, it must first be enabled for your project.
To use Stackdriver Monitoring with one of your projects, do the following:
You are now looking at the Stackdriver Monitoring Console. The information shown will vary depending on the Google (and AWS) services you are using and the monitoring features you have set up, but it will look something like the following:
Let's take an initial look at the monitoring dashboard, because there is a lot of good information here, right from the outset.
In the top left corner, you can see a list of current Uptime checks. This is likely to be empty at this stage, as we have yet to set any up. We will do that in a separate code lab.
Uptime checks let you quickly verify the health of any web page, instance, or group of resources. Each configured check is regularly contacted from a variety of locations around the world. Uptime checks can be used as conditions in alerting policy definitions.
Within Stackdriver Monitoring you can set up alerting policies to define conditions that determine whether or not your cloud services and platforms are operating normally. Stackdriver Monitoring provides many different kinds of metrics and health checks that you can use in the policies.
When an alerting policy's conditions are violated, an incident is created and displayed on in the Incident section that can be found on the dashboard. Responders can acknowledge receipt of the notification and can close the incident when it has been taken care of.
There should be no incidents at this stage (thankfully!).
At the bottom of the dashboard you will find the Event Log.
The Event Log is a list of events that have occurred in your project. This includes system events such as servers being created or being restarted, but you can also add your own message as an event, to keep a record not captured by the monitoring software.
You will also find a variety of graphs and charts on the right hand side that will show you metrics, depending on what resources are currently utilised in your project.
Let's take a look at some of the deeper information we can find out about Compute Engine instances via Stackdriver Monitoring.
You will now be able to see, for this specific Compute Engine Instance:
Let's also take a look at some of the deeper information we can find out about the Cloud SQL instance we created earlier.
You will now be able to see for this specific Cloud SQL instance:
You are well on your way to having your Google Cloud Platform project monitored with Stackdriver Monitoring.