Install and Configure Monitoring Agent with Google Cloud Monitoring

30 minutes
  • 4 Learning Objectives

About this Hands-on Lab

This lab will guide you in the process of installing the optional Monitoring agent on a pre-created Apache web server. Installing and configuring the Monitoring agent allows us to collect more detailed metrics that would not normally be possible, such as memory utilization and application-specific metrics. In this case, we will collect metrics from our Apache web server application.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Initialize Monitoring Workspace
  1. Within your lab project, create a new Cloud Monitoring Workspace, which will monitor only your project.
  2. Once the Workspace is initialized, go to the Compute Engine interface.
Install Monitoring Agent on Compute Engine Instance
  1. Connect to the instance via SSH in the web console. All the below commands will be run in the instance terminal.
  2. Add the agent’s installation location as a repository, and then update your repositories.
  3. Install the latest version of the Monitoring agent.
  4. Verify the agent is working as expected. You should receive feedback that the agent is active and initialization succeeded.
  5. Download the Apache configuration file into the agent’s directory.
  6. Restart the agent.
  7. Exit SSH.
Open the Demonstration Web Page and Generate Some Traffic
  1. Open the web server’s website by clicking on the IP address from the Compute Engine screen.
  2. Refresh your page a few times to generate traffic.
Confirm Agent Installation and Apache Configuration Success in Monitoring Workspace
  1. Go back to your Monitoring Workspace, and open Dashboards.
  2. You should see a new dashboard titled Apache HTTP Server. If it does not appear, wait a few minutes and refresh your screen again.
  3. Enter the dashboard once it does appear.
  4. View the available charts for:
    • HOST (agent-less metrics)
    • AGENT (non-application-specific, agent-collected metrics)
    • APACHE (application-specific metrics)

Additional Resources

Log in to Google Cloud Platform by right-clicking Open Google Console and selecting the option to open it in a new private browser window (this option will read differently depending on your browser — e.g., in Chrome, it says "Open Link in Incognito Window"). Then, sign in using the credentials provided on the lab page.

On the Welcome to your new account screen, review the text, and click Accept. In the "Welcome Cloud Student!" pop-up once you're signed in, check to agree to the terms of service, choose your country of residence, and click Agree and Continue.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?