
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create Project 2's virtual machine
/ 5
Create a Cloud Monitoring Group
/ 5
Uptime Check for your group
/ 5
Alerting Policy for the group
/ 5
Cloud Monitoring provides dashboards and alerts so you can review performance metrics for cloud services, virtual machines, and common open source servers such as MongoDB, Apache, Nginx, Elasticsearch, and more. You configure Cloud Monitoring in the Console.
In this hands-on lab you will have 2 projects to monitor in Cloud Monitoring. You'll add them both to a Cloud Monitoring account and monitor the metrics the virtual machines in the projects provide.
In this lab, you learn how to:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
For this lab you are given two Project IDs. When you logged in, by default you logged into Project 1. You'll need to keep track of your projects, and you can return to this page to remind yourself which is which. The projects will change order, so knowing the last few digits of the name will help you identify them.
Project 1 already has a virtual machine (and you can look at it by going to Compute Engine > VM instances). You will create a virtual machine in Project 2, and then monitor both projects in Cloud Monitoring.
Make sure that you're on the All tab, then click on the name of Project 2 to go into it.
Select Navigation menu > Compute Engine > VM instances to open the VM instances window.
Click Create Instance to create a new instance.
In the Machine configuration:
Enter the values for the following fields:
Field | Value (type or select) |
---|---|
Name | instance2 |
Region | |
Zone |
Leave all of the options at the default settings.
Click Create.
Now you have resources to monitor in both of your projects.
Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted an assessment score.
Set up a Monitoring Metrics Scope that's tied to your Google Cloud Project. The following steps create a new account that has a free trial of Monitoring.
When the Monitoring Overview page opens, your metrics scope project is ready.
Now add both projects to Monitoring.
In the left panel, click Settings and in the Settings window navigate to Metric Scope tab, click +Add projects in the Google Cloud Projects section.
Click Select Projects.
Check Project ID 1 and click Select.
Click Add projects.
Click on Overview in the left menu. You'll be adding a lot of good information here as the lab goes along. First, you'll create a Cloud Monitoring Group for visibility across both projects.
Cloud Monitoring lets you define and monitor groups of resources, such as VM instances, databases, and load balancers. Groups can be based on names, tags, regions, applications, and other criteria. You can also create subgroups, up to six levels deep, within groups.
In the left menu, click Groups, then click +Create group.
Name your group DemoGroup.
The Criteria is a set of rules that will dynamically evaluate which resources should be part of this group.
Cloud Monitoring dynamically determines which resources belong to your group based on the filter criteria that you set up.
instance
.Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted an assessment score.
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.
In the left menu, click Uptime checks, then click +Create uptime check.
Create your uptime check with the following information:
Protocol: TCP
Resource Type: Instance
Applies To: Group, and then select DemoGroup.
Port: 22
Check frequency: 1 minute, then click Continue.
Click Continue again.
Leave the slider ON state for Create an alert option in Alert & notification section, then click Continue.
For Title: enter DemoGroup uptime check
.
Click TEST to verify that your uptime check can connect to the resource.
When you see a green check mark everything can connect, click Create.
Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted an assessment score.
Use Cloud Monitoring to create one or more alerting policies.
In the left menu, click Uptime checks.
Click the three dots at the far right of your Display Name and click Add alert policy.
Click +Add alert condition.
Select the previously created Uptime health check on DemoGroup condition from the left section and click Delete alert condition.
In your New condition, click Select a metric.
Uncheck the Active.
In the Select a metric field, search check_passed
and click VM Instance > Uptime_check > Check passed. Click Apply.
Click Add a filter, set the Filter
to check_id and select demogroup-uptime-check-id as the Value
. Click Done.
demogroup-uptime-check-id
check_id is unavailable, please wait for a few seconds and try.In the left panel, click on the arrow button next to VM Instance-Check passed, then click on Configure trigger.
Select Metric absence as Condition type and click Next.
Turn off Configure notifications.
In the Alert policy name field, enter the Name as Uptime Check Policy. Click Next.
Click Create policy.
Click Check my progress to verify your performed task. If you have completed the task successfully you will be granted an assessment score.
Create a custom dashboard so you can monitor your group easily.
In the left menu, click Dashboards, then click +Create Custom dashboard.
Name your dashboard.
Click +Add Widget and select Line option in Visualization.
In the Metric field, Uncheck the Active.
Search uptime (compute.googleapis.com/instance/uptime) and click VM Instance > Instance > Uptime. Click Apply.
The dashboard should look like:
In the console, select Navigation menu () > Compute Engine**.
Check the box next to instance2, then click on the 3 vertical dots at the top of the page and click Stop. Click Stop again to turn off the machine.
Wait a minute or 2 for the instance to stop and violate the uptime check you just set up. After a couple of minutes, turn your machine back on by clicking Start/Resume, then Start.
Click Navigation menu () > View All Products > Observability > Monitoring > Alerting and refresh your browser. It may take a few more minutes to show that you have issues in the Summary section. Refresh until you see an Incident similar to this:
Optional: Using the left menu, look at Dashboards to view your custom dashboard. This provides details on both VMs. If you mouse over your chart, you can see which of your instances was stopped and restarted.
When the alerting policy conditions are violated, an "incident" is created and displayed in the Incident section.
Responders can acknowledge receipt of the notification and can close the incident when it has been taken care of.
You've already fixed your problem by turning the VM back on, so the incident was cleared and you no longer see an incident in the Incidents section.
Your incident should have a Closed status. You can read through the incident details.
In several more minutes the Monitoring Overview page will all go back to green when the instance in Project 2 passes the Uptime Check.
If you set up an email alert as part of your alerting policy, there is a chance that you will receive a few emails about your resources even after the lab is completed.
To avoid this, remove the alerting policy before you complete your lab.
Below is a true/false question to reinforce your understanding of this lab's concepts. Answer it to the best of your ability.
Congratulations! In this lab, you have monitored two Google Cloud projects in Cloud Monitoring, and responded to an incident with one of the instances in the Group. You also created a custom dashboard to monitor your group easily.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated March 10, 2025
Lab Last Tested March 10, 2025
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one