Configuring the Monitoring Agent

This page describes how to configure which built-in metrics the Monitoring agent collects from a Linux VM. The content on this page is intended for system administrators who want to modify the default configuration of the Monitoring agent.

You cannot configure the Monitoring agent when it is installed on a Windows VM.

This page doesn't describe how to configure the Monitoring agent to monitor third-party applications or how to use the agent to collect custom metrics. For information on those topics, see the following pages:

Before you begin

If you haven't installed the Monitoring agent on a VM, see Installing the Monitoring agent.

Changing the default Monitoring agent configuration

To change the configuration of the Monitoring agent, do the following:

  1. Edit the Monitoring agent configuration file /etc/stackdriver/collectd.conf.

  2. Restart the Monitoring agent by running the following command:

       sudo service stackdriver-agent restart

Stopping the collection of process metrics

For information about how to stop the collection of process metrics—the metrics with the prefix—see Disabling process metrics on Linux VMs.

Configuring reported CPU metrics

By default, the Monitoring agent reports the total CPU utilization by state for all CPUs on the VM by using the metric type. This behavior is specified in the configuration file by the following settings:

  • ValuesPercentage true
  • ReportByCpu false

You must modify these settings if you want the agent to report the utilization per CPU, or if you want it to report CPU usage time,, metrics:

  • To configure the Monitoring agent to report the per CPU, do the following:

    • Leave ValuesPercentage at the default value of true.
    • Set ReportByCpu to true.
  • To configure the Monitoring agent to report the per CPU, do the following:

    • Set ValuesPercentage to false.
    • Set ReportByCpu to true.

The Monitoring agent can either report the CPU utilization or the CPU usage, but not both metrics. This is a known limitation of collectd. When ReportByCpu is true, the ValuesPercentage field determines if the utilization or usage is reported. When ReportByCpu is false, the agent reports the CPU utilization.


If you're having trouble installing or running the agent, see Troubleshooting agent installation.