Start using Cloud Monitoring
There is a short video, "Getting Started," that will get you started with Cloud Monitoring.
To use Google Cloud Monitoring, follow these steps:
- Go to the Google Developers Console and select your project.
- On the left sidebar, select Monitoring > Dashboards & alerts. The features Monitoring > Tracing and Monitoring > Logs are not part of Cloud Monitoring.
- If this is the first time you have used Cloud Monitoring, click Enable Monitoring.
You will now be looking at the Cloud Monitoring Console:
The information shown on this console might vary depending on the Google services you are using and the monitoring features you have set up. For example, the console might include a list of Google App Engine modules or a list of endpoint checks and alerting incidents.
Monitoring App Engine projects
The preceding screenshot displays the following related sections in the Cloud Monitoring Console for App Engine projects:
App Engine shows a list of your App Engine modules along with the number of incidents for each module. Clicking any of the modules here will take you to the detailed dashboard for that module.
Endpoint Checks > GAE Module shows a list of configured endpoint health checks for your App Engine applications, if you have configured them. An App Engine endpoint consists of the module and a path, so in the preceding screenshot you see default / indicating that the check is monitoring the top level URL for module default. See Endpoint health checks to see how endpoints are configured.
To get more detailed App Engine monitoring information click the App Engine section title or click Services > App Engine in the Cloud Monitoring Console top menu.
Monitoring Google Compute Engine projects
The preceding screenshot displays the following related sections in the Cloud Monitoring Console for Google Compute Engine projects:
- Endpoint Checks > Instance shows a list of configured endpoint health checks for your VM instances, if you have configured them. See Endpoint health checks to see how endpoints are configured.
There is no overview section for your Compute Engine instances on the Cloud Monitoring Console. To get instance monitoring information, click Infrastructure > Instances in the Cloud Monitoring Console top menu or click on an instance name.
The Event Log
The Event Log is a list of events that have occurred in your project. You can see the log in the Events section of the Cloud Monitoring Console or you can select Alerting > Event Log from the top menu bar. You can filter the Event Log to see only events of a particular type or events from a particular service. You can also add your own message as an event, to keep a record not captured by the monitoring software.
Event Log entries can note changes related to the following:
- user accounts
- alerting policies
- metric values
- code deployments
- google Cloud status changes, such as outages
- Identity and Access Management roles
- security groups
- incident status
- resource additions, removals, and tag changes
- manually-created notices
Endpoint health checks
There is a short video, "Endpoint Checks," that will get you started with endpoint health checks.
Endpoint health checks let you quickly verify the health of any web page, instance, or group of resources. Each configured endpoint is regularly contacted from a variety of locations around the world. Endpoint checks can be used as conditions in alerting policy definitions.
You can display your endpoints and their health status by selecting Services > Endpoints on the Cloud Monitoring Console. You'll also find Endpoint Checks sections on the Cloud Monitoring Console and on pages devoted to specific resources. For endpoint checks that cover a group of resources, you can expand the check to show the status of the individual members of the group.
Create an endpoint health check
You might be prompted to create an endpoint check when Cloud Monitoring detects the creation of a resource. You can create an endpoint check at any time by following these steps:
Click Add Endpoint in the Endpoint Checks section of the Cloud Monitoring Console.
Select a Resource Type:
Choose Instance to check a single Compute Engine instance or a group of instances.
Choose App Engine to check an App Engine module.
Choose Generic Endpoint to check an arbitrary website or URL.
Depending on the type chosen, fill in the requested information about the endpoint. For Instance and App Engine types, you can usually accept the default values.
When the Test Endpoint button at the bottom of the panel is enabled, click it to test your endpoint.
If you have problems connecting to your endpoint, check the Authentication and Advanced Options sections to see if they might help.
When you create an endpoint check, you are prompted to create an alerting policy for the endpoint. Unless you create an alerting policy, you will have to look at the Endpoint Checks section of the Cloud Monitoring Console to know if your endpoint is healthy. Click Create Alerting Policy to create a policy using a form that is already populated for the endpoint. See Alert Policies to learn how to complete the alert policy.
Dashboards and charts
There is a short video, "Custom Dashboards," that will get you started with dashboards and charts.
You can display the metrics collected by Cloud Monitoring in your own charts and dashboards. A dashboard is a screen that can include one or more charts. Here is a custom dashboard with one chart displaying the volume of network traffic coming into a Compute Engine VM instance:
Create a dashboard and chart
Follow these instructions to create a custom dashboard and chart:
Start from the Cloud Monitoring Console.
Select Dashboards > Create... from the top menu. You will see the text "New Dashboard" above two time scales and a button labeled Add Chart.
Select and replace the text "New Dashboard" with whatever name you wish. In the example it is "My custom dashboard."
Click Add Chart on the dashboard.
Set Title to be a name for the chart. In the example it is "My instance inbound traffic."
Choose a Resource Type from the drop-down list. In the example it is Instance—a Compute Engine VM instance.
Choose a Metric Type from the drop-down list. In the example it is "Network Inbound Traffic (GCE Monitoring)." The listed metrics will be appropriate for your resource type and might depend on other factors, such as whether you installed the Stackdriver Agent.
Under Advanced Options, you can aggregate the time series across resources to view a single line representing the average, median, 95th percentile, sum, etc. You can also add a threshold line to provide a visual indication of normality.
You can display your dashboard from any page in the Cloud Monitoring Console by selecting it from the Dashboards menu at the top of the window.
Edit your charts and dashboards by clicking on the icons at the top right of the charts and dashboards. Use drag-and-drop to reorder the charts in the dashboard.
Groups let you easily monitor collections of related resources. Cloud Monitoring relies on metadata such as names and tags to create groups, so you have flexibility in defining a set of rules to aggregate your resources. For instance, you can create a group for "all VM instances in my project that are running Cassandra databases", or another group for "all endpoints located in Singapore", and so forth.
Create a group
Click Add Group within the Groups section of the Cloud Monitoring Console. If you have added groups before, you can also select Groups > Create... from the top menu list.
Enter a name or phrase to identify the group.
Choose whether you want the group members to match Any or All of the rules you will specify next. If there is only one rule, it doesn't matter which match you choose.
Choose the type of value that you want to test from the dropdown list. Based on the type, fill in the condition that has to be met by members of the group.
To add another rule, click Add Criteria and repeat the previous step.
If this group is a cluster, check the box to highlight when a node's performance or configuration differs from other members in the cluster.
Click Save Group.
You can edit or delete a group by selecting Groups > Groups Overview from the top menu list and then clicking on your group. In the same panel, you can create subgroups of existing groups by clicking + Subgroups.
There is a short video, "Alerting Policies," that will get you started with alerting policies.
You can set up alerting policies to define conditions that determine whether or not your cloud services and platforms are operating normally. Cloud 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 the Cloud Monitoring Console in the Incident section. Responders can acknowledge receipt of the notification and can close the incident when it has been taken care of.
You can also associate notifications with alerting policies, so that individuals or systems are notified when something is wrong.
Create a policy
To create an alerting policy, follow these steps:
Click Create Alerting Policy within the Incident section of the Cloud Monitoring Console. You can also select Alerting > Create Alerting Policy from the top menu list.
Enter a unique policy name or phrase to identify the policy.
Fill in the Add Condition section. You are defining a condition which, if met, will trigger an alert:
- Click on the kind of measurement you want in the condition: Metric Threshold, Metric Absence, Process Health, or Endpoint Health. An explanation of the measurement appears in the Overview pane. Click Next.
- Fill in the Target pane with the resource type and name.
- Fill in the Configuration pane. You will be able to choose metrics and conditions from drop-down lists.
- Click Save Condition
If you want to add another condition, click + add condition, which brings up the Add Condition pane again. You can add up to six conditions.
If you have entered two or more conditions, fill out the Policy Triggers section. The policy trigger determines if you want to trigger on on any of the conditions or only if all are met.
Fill out the Notifications section:
- Select a notification method in the drop-down list. Click Add.
- Fill in the information for that notification method.
- If you want more notifications, click Add to enter each one.
If you wish, fill out the Documentation section. This text will be included in your notifications. For example, it might explain what the recipient should do.