
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 a Compute Engine VM instance
/ 20
Install an Apache Web Server
/ 20
Install the Ops Agent
/ 30
Create an alerting policy
/ 30
In this lab you use Cloud Monitoring to generate traffic and view metrics on the predefined Apache dashboard in the Google Cloud console.
The Apache Web Server integration collects traffic-related metrics, such as the number of open connections or incoming requests. The integration also collects access and error logs. Access logs are parsed into a JSON payload focused on request details, and error logs are parsed for their error code and message.
In this lab, you learn how to perform the following tasks:
In the Google Cloud console, select Navigation menu > Compute Engine > VM Instances.
To create a VM instance, click Create Instance.
In the Machine configuration.
Select the following values:
Property | Value (type value or select option as specified) |
---|---|
Name | quickstart-vm |
Zone | |
Series | E2 |
Machine Type | e2-small |
Click OS and storage.
Click Change to begin configuring your boot disk:
Click Select.
Click Networking.
Click Create. When your VM is ready, it appears in the list of instances in the Instances tab.
Click Check my progress to verify the objective.
To deploy an Apache Web Server on your Compute Engine VM instance, do the following:
Open a terminal to your instance, by clicking the SSH button.
Update the package lists on your instance by running the following:
sudo apt-get install apache2 php
. If asked to continue the installation, enter Y
.
http://EXTERNAL_IP
, where EXTERNAL_IP
is the external IP address of your VM.Click Check my progress to verify the objective.
The following commands create the configuration to collect and ingest telemetry for Apache Web Server and restart the Ops Agent by using the terminal:
You should notice the google-cloud-ops-agent
installation succeeded.
For more information about ingesting logs from the Apache Web Server, see Configure the Ops Agent for Apache Web Server.
Click Check my progress to verify the objective.
Monitoring dashboards lets you view and analyze metrics related to your services. In this lab, you generate metrics on your Apache Web Server and view metric data on the automatically created Apache Overview dashboard.
The previous command generates traffic by making a request to the Apache Web Server every four seconds.
To view the Apache Overview dashboard, do the following:
In the console, search for Monitoring in the top search bar and navigate to the Monitoring service.
In the navigation pane, select Dashboards.
In All Dashboards, select the Apache Overview dashboard. The Apache GCE Overview dashboard opens.
In the dashboard, there are several charts that contain information about your Apache and Compute Engine integration:
Alerting policies instruct Cloud Monitoring to notify you when specified conditions occur.
To set up an email notification channel, do the following:
An email address you have access to
To create an alerting policy that monitors a metric and sends an email notification when the traffic rate on your Apache Web Server exceeds 4 KiB/s, do the following:
In Google Cloud console, select Navigation menu > Monitoring > Alerting and then click Create policy.
Select the time series to be monitored:
The chart for Apache traffic is shown.
In the Transform data section, select the following values and click Next:
1 min
rate
In the Configure alert trigger section, select the following values and click Next:
Any time series violates
Above threshold
4000
In the Configure notifications and finalize alert section, select the following values:
Display name
you have created earlier and click OK.30 min
Apache traffic above threshold
Click Create policy. Your alerting policy is now active.
Click Check my progress to verify the objective.
To test the alerting policy you just created, do the following:
In console, select Navigation menu > Compute Engine.
In the Connect column, click SSH to open a terminal to your VM instance.
In the terminal, enter the following command:
The previous command generates traffic in your Apache Web Server.
After the traffic rate threshold value of 4 KiB/s is exceeded in your Apache Web Server, an email notification is sent. It might take several minutes for this process to complete.
The email notification you receive looks similar to the following:
In this lab, you learned how to install Ops Agent on a VM and use it to set an alerting policy to notify a recipient of potential issues with the instance.
Manual Last Updated December 12, 2024
Lab Last Tested October 22, 2024
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.
Ce contenu n'est pas disponible pour le moment
Nous vous préviendrons par e-mail lorsqu'il sera disponible
Parfait !
Nous vous contacterons par e-mail s'il devient disponible
One lab at a time
Confirm to end all existing labs and start this one