0
0
GCPcloud~30 mins

Cloud Monitoring overview in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Cloud Monitoring overview
📖 Scenario: You are managing a small web application running on Google Cloud Platform (GCP). You want to keep track of your application's health by monitoring CPU usage and uptime. This will help you quickly spot problems and keep your app running smoothly.
🎯 Goal: Build a simple Cloud Monitoring setup using Google Cloud SDK commands to create a monitored resource, configure an uptime check, and list the configured uptime checks.
📋 What You'll Learn
Use the gcloud command-line tool
Create a monitored resource descriptor for a virtual machine instance
Configure an uptime check for the web application
List all uptime checks to verify the setup
💡 Why This Matters
🌍 Real World
Cloud Monitoring helps keep applications healthy by automatically checking if they are up and running. This project shows how to set up basic uptime checks for your services.
💼 Career
Knowing how to configure and manage uptime checks is a key skill for cloud engineers and DevOps professionals to ensure system reliability and quick incident response.
Progress0 / 4 steps
1
Create a monitored resource descriptor
Use the gcloud monitoring resource-descriptors list command to list available monitored resource types. Then create a monitored resource descriptor for a virtual machine instance named my-instance in zone us-central1-a.
GCP
Need a hint?

First, list resource descriptors with gcloud monitoring resource-descriptors list. Then define a dictionary with type as gce_instance and labels for instance_id and zone.

2
Configure an uptime check
Create a variable called uptime_check_config that defines an uptime check for the URL http://my-instance.example.com with a check interval of 60 seconds and timeout of 10 seconds.
GCP
Need a hint?

Define uptime_check_config as a dictionary with keys display_name, http_check, resource, period, and timeout. Use the monitored resource from Step 1.

3
Create the uptime check using gcloud
Use the gcloud monitoring uptime-checks create http command to create an uptime check for the URL http://my-instance.example.com with a check interval of 60 seconds and timeout of 10 seconds.
GCP
Need a hint?

Use the gcloud monitoring uptime-checks create http command with flags --display-name, --host, --path, --period, and --timeout.

4
List all uptime checks
Use the gcloud monitoring uptime-checks list command to display all configured uptime checks and verify that your uptime check named My Instance Uptime Check is listed.
GCP
Need a hint?

Run gcloud monitoring uptime-checks list to see all uptime checks. Look for the name My Instance Uptime Check in the output.