View your log-based metrics

Stay organized with collections Save and categorize content based on your preferences.

This page describes the Logs-based metrics page in the Google Cloud console. You use this page to do the following:

Before you begin

To use log-based metrics, you must have a Cloud project with billing enabled:

  1. In the Google Cloud console, go to the project selector page.

    Go to project selector

  2. To begin creating a Google Cloud project, click Create project.

  3. Name your project. Make a note of your generated project ID.

  4. Edit the other fields as needed.

  5. To create the project, click Create.

Make sure that billing is enabled for your Cloud project. Learn how to check if billing is enabled on a project.

To verify that you have the correct permissions to use log-based metrics for the Cloud project, see Access control with IAM.

View log-based metrics

To view a list of log-based metrics for your Google Cloud project, do the following:

  1. Go to the Logs-based metrics page in the Google Cloud console:

    Go to Log-based metrics

  2. Select an existing Cloud project. The lists of log-based metrics in your Cloud project appear.

The log-based metrics interface is divided into two metric-type panes: System metrics and User-defined metrics.

Each pane contains a table summary of the metrics. Each metric's row has a menu that features the following options:

  • View in Metrics Explorer lets you view the data for a system log-based metric by opening Metrics Explorer in Cloud Monitoring.

    You can use Metrics Explorer to specify a target metric for an alerting policy. The chart next to the Target region gives you visual feedback on the data being captured by the target metric.

  • Create alert from metric lets you create an alerting policy based on the log-based metric.

    Selecting this option opens the Cloud Monitoring console, where you can create, edit, and manage alerting policies. For details on creating alerting policies for your log-based metrics, read Creating an alerting policy.

User-defined metrics pane

The User-defined metrics pane of the log-based metrics interface has several features to help you manage the user-defined metrics on your Cloud project:

  • The user-defined metrics table includes Name, Description, Type, and Filter columns. These are specified when you create the metric.

  • The Filter user-defined metrics pane lets you filter your metric list by text search or metric Name, Description, and Filter.

  • The user-defined metrics table includes columns for Previous month usage and Month-to-date usage (MTD). This usage data is useful, for example, if you want to determine which metrics ingest the most data or to estimate your bills.

Clicking on any of the column names lets you sort data in ascending or descending order.

The menu for each metric in your user-defined metrics pane contains additional features for managing your metrics:

The user-defined log-based metrics pane overflow menu options.

  • View metric details: Shows you the metric's Name, Type, Description, Filter, Units, and Labels, if defined.
  • Edit metric: Lets you edit certain fields for the metric.
  • Disable metric: Lets you stops the metric from being calculated. You can re-enable a disabled metric from the same menu.
  • Delete metric: Lets you delete the metric.
  • View logs for metric: Takes you to the Logs Explorer and populates the metric's filter in the Query builder and runs the query.