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 see a "request account button" at the top of the main Codelabs window, click it to obtain a temporary account. Otherwise ask one of the staff for a coupon with username/password.
These temporary accounts have existing projects that are set up with billing so that there are no costs associated for you with running this codelab.
Note that all these accounts will be disabled soon after the codelab is over.
Use these credentials to log into the machine or to open a new Google Cloud Console window https://console.cloud.google.com/. Accept the new account Terms of Service and any updates to Terms of Service.
Here's what you should see once logged in:
When presented with this console landing page, please select the only project available. Alternatively, from the console home page, click on "Select a Project" :
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.