Google Cloud: How to Configure Resource Monitoring

Share At:

In this lab, you will learn how to use Cloud Monitoring to gain insight into applications that run on Google Cloud.

In this lab, you learn how to perform the following tasks:

  • Explore Cloud Monitoring
  • Add charts to dashboards
  • Create alerts with multiple conditions
  • Create resource groups
  • Create uptime checks

Task 1: Create a Cloud Monitoring workspace

Verify resources to monitor

Three VM instances have been created for you that you will monitor.

  1. In the Cloud Console, on the Navigation menu > click Compute Engine > VM instances. Notice the nginxstack-1nginxstack-2 and nginxstack-3 instances.

Create a Monitoring workspace

You will now setup a Monitoring workspace that’s tied to your Qwiklabs GCP Project. The following steps create a new account that has a free trial of Monitoring.

  1. In the Google Cloud Platform Console, click on Navigation menu > Monitoring.
  2. Wait for your workspace to be provisioned.

When the Monitoring dashboard opens, your workspace is ready.

Task 2: Custom dashboards

Create a dashboard

  1. In the left pane, click Dashboards.
  2. Click +Create Dashboard.
  3. For New Dashboard Name, type My Dashboard.

Add a chart

  1. From Chart library, Select Line.
  2. For Title, give your chart a name (you can revise this before you save based on the selections you make).
  3. For Resource type, select VM Instance.
  4. For Metric, select a metric to chart for the Instance resource, such as CPU utilization or CPU usage.
  5. Click + Add Filter and explore the various options.

Metrics Explorer

The Metrics Explorer allows you to examine resources and metrics without having to create a chart on a dashboard. Try to recreate the chart you just created using the Metrics Explorer.

  1. In the left pane, click Metrics Explorer.
  2. For Find resource type and metric, type a metric or resource name.
  3. Explore the various options and try to recreate the chart you created earlier.

Task 3: Alerting policies

Create an alert and add the first condition

  1. In the left pane, click Alerting.
  2. Click + Create Policy.
  3. Click Add Condition.
  4. For Find resource type and metric, select VM Instance.

If you cannot locate the VM Instance resource type, you might have to refresh the page.

5. Select a metric you are interested in evaluating, such as CPU usage or CPU Utilization.

6. Under Configuration, for Condition, select is above.

7. Specify the threshold value and for how long the metric must cross this set value before the alert is triggered. For example, for THRESHOLD, type 20 and set FOR to 1 minute.

8. Click ADD.

Add a second condition

  1. Click Add Condition.
  2. Repeat the steps above to specify the second condition for this policy. For example, repeat the condition for a different instance. Click ADD.
  3. In Policy Triggers, for Trigger when, click All conditions are met.
  4. Click Next.

Configure notifications and finish the alerting policy

  1. Click on dropdown arrow next to Notification Channels, then click on Manage Notification Channels.

Notification channels page will open in new tab.

2. Scroll down the page and click on ADD NEW for Email.

3. Enter your personal email in the Email Address field and a Display name.

4. Click Save.

5. Go back to the previous Create alerting policy tab.

6. Click on Notification Channels again, then click on the Refresh icon to get the display name you mentioned in the previous step.

7. Now, select your Display name and click OK.

8. Click Next.

9. Enter a name of your choice in Alert name field.

10. Click Save.

Task 4: Resource groups

  1. In the left pane, click Groups.
  2. Click + Create Group.
  3. Enter a name for the group. For example: VM instances
  4. In the Criteria section, type nginx in the value field below Contains.
  5. Click DONE.
  6. Click CREATE.
  7. Review the dashboard Cloud Monitoring created for your group.

Task 5: Uptime monitoring

  1. In the Monitoring tab, click on Uptime Checks.
  2. Click + Create Uptime Check.
  3. Specify the following, and leave the remaining settings as their defaults:

4. Click on Next to leave the other details to default. Under Alert & Notification, select your Notification Channels from the dropdown.

5. Click Test to verify that your uptime check can connect to the resource.

6. When you see a green check mark everything can connect. Click Create.

7. The uptime check you configured takes a while for it to become active.

This concludes our lab — Resource Monitoring

Happy Learning !!!

Share At:
0 0 votes
Article Rating
Notify of
Oldest Most Voted
Inline Feedbacks
View all comments
inscreva-se na binance

I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

Binance registrácia
1 month ago

Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

Back To Top

Contact Us