Using quota metrics

This page describes how to create alerting policies and charts to monitor quota allocated to you by Google Cloud. Google Cloud establishes a number of quotas that you can use to track and limit the resources consumed by a project or organization. For general information about quotas, including information on allocation quotas and rate quotas, see Working with quotas.

Before you begin

This page assumes familiarity with time-series data and its manipulation. The following pages provide additional information:

Working with quota metrics

Cloud Monitoring manages quota in two ways:

  1. Consumer quota. For this type of quota, the monitored resource is consumer_quota. The metrics for this resource are a subset of the serviceruntime metrics.

    Most of the examples on this page are consumer-quota examples.

  2. Resource-specific quotas. Some services provide monitored resources that have resource-specific metrics for quotas. These metric types appear in groups of three, following this pattern:

    • service/quota/quota-type/exceeded
    • service/quota/quota-type/limit
    • service/quota/quota-type/usage

    For example, Compute Engine has the compute.googleapis.com/VpcNetwork resource. The quota-related metrics associated with this resource are the compute.googleapis.com/quota subset of the compute metrics. There are three metric types related to the "instances per VPC network" quota:

Identifying quota metrics and limit names

Raw data about quota consumption, particularly for consumer quota, can include information about many different quotas. To extract information about a specific quota for a chart or alerting policy, you need to identify that subset of quota data.

Depending on the source, quota data might include labels that you can use to isolate the information you want. These labels include the following:

  • Quota metric: The quota metric is an identifier for a type of quota; it is not one of the metric types described in Metrics list. For example, all consumer-quota data is written as serviceruntime.googleapis.com metric type like quota/allocation/usage. This metric type has a quota_metric label that can be used to filter for a specific quota, for example, allocation-usage data.
  • Limit name: The limit name identifies a limit on a specific type of quota. A quota can have more than one limit associated with it. For example, a quota for read calls might have a per-minute limit of 100 and a per-day limit of 1000, with two limit names, readsPerMinute and readsPerDay. Quota-related metric types might have a limit_name field for this value.

All serviceruntime.googleapis.com/quota metric types provide the quota_metric label, but only some include the limit_name label. Resource-specific metric types for quota include the limit_name label.

To identify specific quota metrics and limit names, you can use the following procedure:

  1. In the Google Cloud Console, go to the Admin Quotas page:

    Go to Quotas

  2. Locate the quota of interest and then click All quotas.

  3. If a service supports quota metrics, then Quota Metric and Limit Name fields are displayed. For example, the following screenshot for the Compute Engine API subnetworks quota shows that the quota metric is compute.googleapis.com/subnetworks and the limit name is SUBNETWORKS-per-project:

    Example of a quota metric details page.

If the detail information does not list a quota metric or a limit name, then the service doesn't support quota metrics.

If the detail information does not include a monitored resource, then the monitored resource is consumer_quota. Otherwise, this quota shown on the details page is a resource-specific quota for the named monitored resource. The previous screenshot does not explicitly list a monitored resource, so that quota uses the consumer_quota monitored resource.

Example: Viewing usage for a specific consumer quota metric

The goal is to create a chart that displays, by region, Compute Engine's total disk-storage quota. This consumer-quota example retrieves quota/allocation/usage data, and then filters the data so that allocation usage for a specific quota metric is displayed:

  1. In the Google Cloud Console, select Cloud Monitoring, and then select Metrics Explorer.

  2. Configure Metrics Explorer to display the allocation quota usage by setting the resource type to Consumer Quota and setting the metric type to Allocation quota usage:

    Select consumer quota.

    The chart displays the allocation-quota usage as a bar chart for the period of six weeks. By viewing the legend, you see that the chart displays the quota usage for multiple services.

    If you use the Cloud Monitoring API, then the equivalent filter value is:

    metric.type="serviceruntime.googleapis.com/quota/allocation/usage" resource.type="consumer_quota"
    
  3. To limit the chart to the Compute Engine service, add the filter service = "compute.googleapis.com":

    Filter consumer quota by compute service.

    If you use the Cloud Monitoring API, then the equivalent filter value is:

    metric.type="serviceruntime.googleapis.com/quota/allocation/usage" resource.type="consumer_quota" resource.label.service="compute.googleapis.com"
    

    The chart now displays the time series for the allocated quota usage for Compute Engine quotas. The legend displays the value of the quota_metric label for each displayed time series. This value identifies the specific quota. For example, compute.googleapis.com/disks_total_storage identifies the time series for Compute Engine's total disk-storage quota.

    The chart displays quota usage only for those quotas that have recorded usage. For example, if the project doesn't have any Compute Engine resources, then filtering for the compute.googleapis.com service results in a chart with no data.

  4. To create a chart that displays Compute Engine's total disk storage quota usage, use the filter quota_metric = "compute.googleapis.com/disks_total_storage":

    Filter consumer quota by quota metric.

    If you use the Cloud Monitoring API, then the equivalent filter value is:

    metric.type="serviceruntime.googleapis.com/quota/allocation/usage" resource.type="consumer_quota" metric.label.quota_metric="compute.googleapis.com/disks_total_storage"
    
  5. The previous chart displays time series for the regions us-centra1 and us-east1, and for multiple zones including the zone us-central1-a.

    To refine the chart so that it displays data only for the regions, without the zones, add a filter based on the location label. For this example, where both regions are prefixed by us- and end with 1, a filter that uses the regular expression location =~"^us.*1$" works well:

    Filter by quota metric and region.

For consumer quota, the value of the quota_metric label identifies both the service and the specific quota usage being monitored. You can use that information to create charts or alerting policies that monitor a specific quota metric.

Alerting policies in Cloud Monitoring

Alerting policies are a way to configure Cloud Monitoring to notify you when something, like reaching 85% of your limit on a quota, happens.

An alerting policy is a collection of conditions and notification information:

  • A condition describes what is being monitored, how the time-series data for that resource is to be combined, and when an alert must be generated. An alerting policy must specify at least one condition.
  • The notification channel specifies who is to be notified, and how they are to be notified, when an alert occurs. For example, you can configure the alerting policy to send email to a specific person or to a group of people.

There are two techniques you can use to create alerting-policy conditions:

  • Using Monitoring filters to select and manipulate data. For example, when you use the graphical interface to create alerting-policy conditions, you are creating filters. The example shown in Working with quota metrics uses filters to select data for a chart. You can also use filters in requests to the Monitoring API.

  • Using Monitoring Query Language (MQL) to select and manipulate data. MQL is a text-based query language. With MQL Query Editor, you can create queries that you can't create with the filter-based technique. We recommend that you use MQL for creating ratio-based alerting policies. For more information, see MQL alerting-policy examples.

This page discusses both techniques. You can also create charts by using either technique.

Filter alerting-policy examples

In this section, each subsection includes a JSON representation of an alerting policy, along with a pair of tables that describe how to configure the policy in the Google Cloud Console:

  • The first table describes what is being monitored and how the data is to be combined.
  • The second table describes when an alert is to be generated.

These examples are for the filter-based approach.

None of these policies compute ratios. For ratio-based examples, see MQL alerting-policy examples.

Alerting on quota/exceeded errors

You can create an alerting policy to notify you if any service in your Google Cloud project is reporting a quota exceeded error. You can create this type of policy by using Google Cloud Console or by using the Cloud Monitoring API.

Using the Google Cloud Console

The remainder of the content in this subsection is for the conditions dialog of an alerting policy.

Complete the Target dialog by using the settings in the following table. These setting specify that you want to monitor the time series data for the serviceruntime metric /quota/exceeded for all services in your Google Cloud project, and that you want to group the data by the quota limit.

Target pane
Field

Value
Resource type Enter consumer_quota
Metric Select serviceruntime.googleapis.com/quota/exceeded
Filter

Add a filter so the chart only displays data for the service that you want to monitor. For example, to monitor the Identity and Access Management service, add the folliowing filter: service = iam.googleapis.com.

When the filter field is empty, all available metric data is included in the chart.

Group By

Select quota_metric.

This option groups the data by the type of name of the quota_metric.

Aggregator

Select sum.

The aggregation field is automatically set to sum when data is grouped. This setting defines how the data in the individual time series is combined.

Period Select 1 m
Advanced Aggregation Aligner: count true

This metric is of type GAUGE, meaning each data point in the time series is an instantaneous measurement. The value type is BOOL. A value of true indicates that the quota was exceeded.

For this metric, the aligner settings of count true and count are equivalent.

Complete the Configuration dialog by using the following settings. These settings cause the alerting policy to create an alert if the number of quota-exceeded errors exceeds the value of 0 for 1 m. A value of 0 is selected here because quota exceeded errors are unexpected and an indication that a quota needs to be increased or that a service needs to be modified to reduce the API requests. You might want to use a higher threshold.

Configuration pane
Field

Value
Condition triggers if Any time series violates
Condition is above
Threshold 0
For 1 m

Using the Cloud Monitoring API

You can create this alerting policy using the API method alertPolicies.create. You can invoke the Cloud Monitoring API directly, by using the gcloud command-line tool, or by using client libraries. For more information, see Creating policies.

For information on representing alerting policies in JSON or YAML, see Sample policies.

A representation of this alerting policy in JSON format follows.


{
    "combiner": "OR",
    "conditions": [
      {
        "conditionThreshold": {
          "aggregations": [
            {
              "alignmentPeriod": "60s",
              "crossSeriesReducer": "REDUCE_SUM",
              "groupByFields": [
                "metric.label.quota_metric"
              ],
              "perSeriesAligner": "ALIGN_COUNT_TRUE"
            }
          ],
          "comparison": "COMPARISON_GT",
          "duration": "60s",
          "filter": "metric.type=\"serviceruntime.googleapis.com/quota/exceeded\" resource.type=\"consumer_quota\"",
          "trigger": {
            "count": 1
          }
        },
        "displayName": "Quota exceeded error by label.quota_metric SUM",
      }
    ],
    "displayName": "Quota exceeded policy",
  }

Alerting on the absolute quota/allocation/usage

You can create an alerting policy to notify you if the allocation quota usage for a specific service in your Google Cloud project is exceeding a user-specified threshold. You can create this type of policy by using Google Cloud Console or by using the Cloud Monitoring API.

Using the Google Cloud Console

The remainder of the content in this subsection is for the conditions dialog of an alerting policy.

Complete the Target dialog by using the settings in the following table. These setting specify that you want to monitor the time series data for the serviceruntime metric /quota/allocation/usage for one service in your Google Cloud project, and that you want to group the data by the quota limit.

Target pane
Field

Value
Resource type Enter consumer_quota
Metric Select serviceruntime.googleapis.com/quota/allocation/usage
Filter

Add a filter so the chart only displays data for the service that you want to monitor. For example, to monitor the Identity and Access Management service, add the folliowing filter: service = iam.googleapis.com.

When the filter field is empty, all available metric data is included in the chart.

Group By

Select quota_metric.

This option groups the data by the type of name of the quota_metric.

Aggregator

Select sum.

The aggregation field is automatically set to sum when data is grouped. This setting defines how the data in the individual time series is combined.

Period Select 1440 m

The period matches is the sampling interval for this metric.

Advanced Aggregation Aligner: next older

The aligner is set to next older to include the measured value of this GAUGE metric.

Complete the Configuration dialog by using the following settings. These settings cause the alerting policy to create an alert if the value of the time series exceeds 2.5 for 1440 m. The value of 1440 m matches the alignment period. The value of 2.5 was selected for this example, because it is slightly higher than the normal value for the test system. You should select the threshold based on the service you are monitoring in combination with an understanding of the expected range of values for the metric.

Configuration pane
Field

Value
Condition triggers if Any time series violates
Condition is above
Threshold 2.5
For 1440 m

Using the Cloud Monitoring API

You can create this alerting policy using the API method alertPolicies.create. You can invoke the Cloud Monitoring API directly, by using the gcloud command-line tool, or by using client libraries. For more information, see Creating policies.

For information on representing alerting policies in JSON or YAML, see Sample policies.

A representation of this alerting policy in JSON format follows.


{
    "combiner": "OR",
    "conditions": [
      {
        "conditionThreshold": {
          "aggregations": [
            {
              "alignmentPeriod": "86400s",
              "crossSeriesReducer": "REDUCE_SUM",
              "groupByFields": [
                "metric.label.quota_metric"
              ],
              "perSeriesAligner": "ALIGN_NEXT_OLDER"
            }
          ],
          "comparison": "COMPARISON_GT",
          "duration": "84600s",
          "filter": "metric.type=\"serviceruntime.googleapis.com/quota/allocation/usage\" resource.type=\"consumer_quota\" resource.label.\"service\"=\"iam.googleapis.com\"",
          "thresholdValue": 2.5,
          "trigger": {
            "count": 1
          }
        },
        "displayName": "Allocation quota usage for iam.googleapis.com by label.quota_metric SUM",
      }
    ],
    "displayName": "Absolute quota usage policy",
  }

MQL alerting-policy examples

MQL is a text-based query language that uses a series of operations that are linked by pipes. MQL lets you build more powerful and flexible queries than you can build with Monitoring filters. We recommend that you use MQL for setting up ratio-based alerting policies. For example, with MQL, you can set up a ratio for rate-quota usage, which requires computing the ratio of a gauge metric (the limit) and a delta metric (the rate).

You can create MQL-based alerting policies by using the Cloud Console or the Monitoring API:

For information specific to MQL, see Using Monitoring Query Language. For more information on MQL-based alerting policies, see Alerting policies with MQL.

Ratio alert on usage of rate quota for one limit

The following MQL query pattern describes an alert that monitors when the per-minute rate usage of a specific resource service exceeds 80% of a specific limit:

fetch consumer_quota
| filter resource.service == 'sample.googleapis.com'
| { metric serviceruntime.googleapis.com/quota/rate/net_usage
    | align delta_gauge(1m)
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        sum(value.net_usage)
  ; metric serviceruntime.googleapis.com/quota/limit
    | filter metric.limit_name == 'myApiLimitPerDay'
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        sliding(1m), max(val()) }
| ratio
| every 1m
| condition gt(val(), 0.8 '1')

To use this query pattern, make the following changes:

  • Replace sample.googleapis.com with the service you want to monitor.
  • Replace myApiLimitPerDay for the metric.limit_name with the limit you want to track. For information on finding limit names, see Identifying quota metrics and limit names
  • Replace 1m in the delta_gauge and sliding functions with an appropriate window for your limit.

Don't modify the every 1m operation, which determines how frequently the condition is checked.

You can't create this query with filters.

Ratio alert on usage of rate quota with wildcards

MQL supports filtering with wildcards, regular expressions, and boolean logic. For example, you can use MQL to create an alert that tracks multiple limits and warns you if any exceeds a threshold.

The following MQL query pattern describes an alert that monitors when the per-minute or per-day rate usage of any resource services exceeds 80%:

fetch consumer_quota
| filter resource.service =~ '.*'
| { { metric serviceruntime.googleapis.com/quota/rate/net_usage
      | align delta_gauge(1m)
      | group_by [resource.project_id, metric.quota_metric, resource.location],
          sum(value.net_usage)
    ; metric serviceruntime.googleapis.com/quota/limit
      | filter metric.limit_name =~ '.*PerMinute.*'
      | group_by [resource.project_id, metric.quota_metric, resource.location],
          sliding(1m), max(val()) }
    | ratio
  ; { metric serviceruntime.googleapis.com/quota/rate/net_usage
      | align delta_gauge(1d)
      | group_by [resource.project_id, metric.quota_metric, resource.location],
          sum(value.net_usage)
    ; metric serviceruntime.googleapis.com/quota/limit
      | filter metric.limit_name =~ '.*PerDay.*'
      | group_by [resource.project_id, metric.quota_metric, resource.location],
          sliding(1d), max(val()) }
    | ratio }
| union
| every 1m
| condition gt(val(), 0.8 '1')

To use this query pattern, make the following changes:

  • Replace the regular expression for the resource.service with a regular expression for the services you want to track.
  • In the first ratio:
    • Replace .*PerMinute.* for the metric.limit_name with a regular expression for the first group of limits you want to track. For information on finding limit names, see Identifying quota metrics and limit names
    • Replace 1m in the delta_gauge and sliding functions with a window appropriate to your limits.
  • In the second ratio:
    • Replace .*PerDay.* for the metric.limit_name with a regular expression for the second group of limits you want to track.
    • Replace 1d in the delta_gauge and sliding functions with a window appropriate to your limits.

Don't modify the every 1m operation, which determines how frequently the condition is checked.

You can't create this query with filters.

Ratio alert on usage of allocation quota for one limit

The following MQL query pattern describes an alert that monitors when the per-day allocation usage of a specific resource service exceeds 80% of a specific limit:

fetch consumer_quota
| filter resource.service == 'sample.googleapis.com'
| { metric serviceruntime.googleapis.com/quota/allocation/usage
    | align next_older(1d)
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        max(val())
  ; metric serviceruntime.googleapis.com/quota/limit
    | filter metric.limit_name == 'CPUs-per-project'
    | align next_older(1d)
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        min(val())
  }
| ratio
| every 1m
| condition gt(val(), 0.8 '1')

To use this query pattern, make the following changes:

  • Replace sample.googleapis.com with the service you want to monitor.
  • Replace CPUs-per-project for the metric.limit_name with the limit you want to track. For information on finding limit names, see Identifying quota metrics and limit names

Don't modify the every 1m operation, which determines how frequently the condition is checked.

Example: CPU usage of 75% in any region

The following query creates an alerting policy that triggers when the CPU usage of Compute Engine VM instance goes above 75% of the limit in any region:

fetch consumer_quota
| filter resource.service == 'compute.googleapis.com'
| { metric serviceruntime.googleapis.com/quota/allocation/usage
    | align next_older(1d)
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        max(val())
  ; metric serviceruntime.googleapis.com/quota/limit
    | filter metric.limit_name == 'CPUS-per-project-region'
    | align next_older(1d)
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        min(val())
  }
| ratio
| every 1m
| condition gt(val(), 0.75 '1')

This consumer-quota policy uses the CPUS-per-project-region limit name in the Compute Engine API "CPUs" quota. For information on finding limit names, see Identifying quota metrics and limit names.

Ratio alert on usage of allocation quota for any service

MQL supports filtering with wildcards, regular expressions, and boolean logic. For example, you can use MQL to create an alert that tracks multiple limits or services and warns you if any exceeds a threshold.

The following MQL query describes an alert that monitors when the per-day allocation usage of any resource service exceeds 80% for any of quota limits:

fetch consumer_quota
| filter resource.service =~ '.*'
| { metric serviceruntime.googleapis.com/quota/allocation/usage
    | align next_older(1d)
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        max(val())
  ; metric serviceruntime.googleapis.com/quota/limit
    | align next_older(1d)
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        min(val())
  }
| ratio
| every 1m
| condition gt(val(), 0.8 '1')

You can use this query as presented, or you can replace the regular expression for the resource.service with a regular expression for the services you want to track. You can also filter on a specific service and use wildcards in a limit filter.

Don't modify the every 1m operation, which determines how frequently the condition is checked.

Example: CPU usage above 50% in specific zones

The following query creates an alerting policy that triggers when the CPU usage of Compute Engine VM instances goes above 50% of the limit in any of the us-central1 zones. This query filters the limit data by a limit name and the resource location:

fetch consumer_quota
| filter resource.service == 'compute.googleapis.com'
| { metric serviceruntime.googleapis.com/quota/allocation/usage
    | align next_older(1d)
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        max(val())
  ; metric serviceruntime.googleapis.com/quota/limit
    | filter metric.limit_name == 'CPUS-per-project-zone' && 
             resource.location =~ 'us-central1-.*'
    | align next_older(1d)
    | group_by [resource.project_id, metric.quota_metric, resource.location],
        min(val())
  }
| ratio
| every 1m
| condition gt(val(), 0.50 '1')

This consumer-quota policy uses the CPUS-per-project-zone limit name in the Compute Engine API "CPUs" quota. For information on finding limit names, see Identifying quota metrics and limit names.

Ratio alert using resource-specific quota

You can use MQL to set up ratios for resource-specific quota-related metrics. In this case, you specify a service-specific monitored resource and compute a ratio over a pair of resource-specific quota-relateds metrics.

The following query pattern describes an alert that monitors when the usage of a quota exceeds 80% of the limit:

fetch sample.googleapis.com/SampleResource
| { metric sample.googleapis.com/quota/samplemetric/usage
    | align next_older(1d)
    | group_by [resource.label_1, ... , resource.label_n,
                metric.label_1, ... , metric.label_n],
        max(val())
  ; metric sample.googleapis.com/quota/samplemetric/limit
    | align next_older(1d)
    | group_by [resource.label_1, ... , resource.label_n,
                metric.label_1, ... , metric.label_n],
        min(val())
  }
| ratio
| every 1m
| condition gt(val(), 0.8 '1')

To use this query pattern, make the following changes:

  • Replace sample.googleapis.com with the service you want to monitor.
  • Replace sampleResource with the associated monitored resource.
  • Replace samplemetric with the string for a group of metric types.
  • In the group_by operations, list each of the resource and metric labels.

Example: CPU usage of 75% in any region

For example, the following MQL query sets up an alert that monitors when the usage of the Compute Engine instances_per_vpc_network quota exceeds 80% for any network ID:

fetch compute.googleapis.com/VpcNetwork
| { metric compute.googleapis.com/quota/instances_per_vpc_network/usage
    | align next_older(1d)
    | group_by [resource.resource_container, metric.limit_name,
                resource.location, resource.network_id],
        max(val())
  ; metric compute.googleapis.com/quota/instances_per_vpc_network/limit
    | align next_older(1d)
    | group_by [resource.resource_container, metric.limit_name,
                resource.location, resource.network_id],
        min(val())
  }
| ratio
| every 1m
| condition gt(val(), 0.80 '1')

Note that this query uses the resource type compute.googleapis.com/VpcNetwork, not consumer_quota, and it takes the ratio of two compute.googleapis.com/quota/instances_per_vpc_network metrics, usage and limit.

Chart examples

Charts display time-series data. You can use Metrics Explorer to create a chart. With Metrics Explorer you can either discard the chart when you no longer need it, or you can save it to a dashboard. In the dashboard view, you can add a chart to the dashboard.

To create a chart, you specify what you want to view and how you want to view that data. The remainder of this section contains settings that can be used to create charts for both consumer quota and resource-specific quota. You can also use the settings for Target dialog of an alerting policy to create a chart.

Maximum usage in interval for quota/allocation/usage

To view the time series data for the serviceruntime metric quota/allocation/usage, for all services in your Google Cloud project, where the data is grouped by the name of the quota metric and the maximum value of the metric in a 25-hour interval is displayed, use the following settings:

Target pane
Field

Value
Resource type Enter consumer_quota
Metric Select serviceruntime.googleapis.com/quota/allocation/usage
Filter

Add a filter so the chart only displays data for the service that you want to monitor. For example, to monitor the Identity and Access Management service, add the folliowing filter: service = iam.googleapis.com.

When the filter field is empty, all available metric data is included in the chart.

Group By

Select quota_metric.

This option groups the data by the type of name of the quota_metric.

Aggregator

Select sum.

The aggregation field is automatically set to sum when data is grouped. This setting defines how the data in the individual time series is combined.

Period Select 1500 m

The period, 25 hours, is slightly longer than the sampling interval for this metric.

Advanced Aggregation Aligner: max
Secondary aggregator:sum

The aligner is set to display the maximum value of the metric measured over the alignment period. The secondary aggregator combines the time series for the different services into a single time series.

Time series for quota/rate/net_usage

To view the time series data for the serviceruntime metric quota/rate/net_usage, for all services in your Google Cloud project, where the data is grouped by the name of the quota metric and the rate of usage is displayed, use the following settings:

Target pane
Field

Value
Resource type Enter consumer_quota
Metric Select serviceruntime.googleapis.com/quota/rate/net_usage
Filter

Add a filter so the chart only displays data for the service that you want to monitor. For example, to monitor the Identity and Access Management service, add the folliowing filter: service = iam.googleapis.com.

When the filter field is empty, all available metric data is included in the chart.

Group By

Select quota_metric.

This option groups the data by the type of name of the quota_metric.

Aggregator

Select sum.

The aggregation field is automatically set to sum when data is grouped. This setting defines how the data in the individual time series is combined.

Period Select 1 m

The period of 1 minute matches the sampling interval for this metric.

Advanced Aggregation Aligner: rate

By setting the aligner to the value of rate, the values stored in the time series for this DELTA metric are converted into a new time series that stores rate data. The y-axis for the chart has the units of quota per second.

Time series for quota/limit

To view the time series data for the serviceruntime metric quota/limit, for all services in your Google Cloud project, where the data is aggregated over 25 hours, use the following settings:

Target pane
Field

Value
Resource type Enter consumer_quota
Metric Select serviceruntime.googleapis.com/quota/limit
Filter

Add a filter so the chart only displays data for the service that you want to monitor. For example, to monitor the Identity and Access Management service, add the folliowing filter: service = iam.googleapis.com.

When the filter field is empty, all available metric data is included in the chart.

Group By Leave empty.
Aggregator none
Period Select 1500 m
Advanced Aggregation Aligner: next older

The aligner is set to next older to display the measured value of this GAUGE metric. The alignment period, 25 hours, is slightly longer than the sampling interval for this metric.

Time series for quota/instances_per_vpc_network/limit

To view the time series data for the compute.googleapis.com metric quota/instances_per_vpc_network/limit, for all the networks in your Google Cloud project, use the following settings:

Target pane
Field

Value
Resource type Enter compute.googleapis.com/VpcNetwork
Metric Select compute.googleapis.com/quota/instances_per_vpc_network/limit
Filter Leave empty
Group By Leave empty
Aggregator Leave as none
Period Select 1 m

The period matches is the sampling interval for this metric.

Advanced Aggregation Ignore

Time series for quota/instances_per_vpc_network/usage

To view the time series data for the compute.googleapis.com metric quota/instances_per_vpc_network/usage, for one of the networks in your Google Cloud project, use the following settings:

Target pane
Field

Value
Resource type Enter compute.googleapis.com/VpcNetwork
Metric Select compute.googleapis.com/quota/instances_per_vpc_network/usage
Filter

Add a filter so the chart only displays a subset of all the data. For example, to see the usage for a specific network, add the following filter: network_id = identifier.

When the filter field is empty, all available metric data is included in the chart.

Group By Leave empty
Aggregator Leave as none
Period Select 1 m
Advanced Aggregation Ignore

MQL charts

You can use MQL queries to create charts by using the MQL Query Editor. For example, any of the queries shown in MQL alerting policy examples can be entered into the Query Editor. You can omit the last operation, condition, in each query; it applies except when creating a condition for an alerting policy. In a chart, the condition operation does nothing.

For more information, see Using the Query Editor and MQL examples.