Monitor trace quota usage and spans ingested

You can create alerting policies in Cloud Monitoringto monitor the number of Cloud Trace spans ingested per month,your quota usage, and your rate of span ingestion. If you have never createdan alerting policy, seeManaging alerting policies fordetailed information about using the Cloud Monitoring console.

Monitor over-quota on Cloud Trace API usage

To create an alerting policy that triggers when your monthlyCloud Trace spans ingested exceeds your quota, use the following settings.

Steps to create an alerting policy.

To create an alerting policy, do the following:

  1. In the Google Cloud console, go to the Alerting page:

    Go toAlerting

    If you use the search bar to find this page, then select the result whose subheading isMonitoring.

  2. If you haven't created your notification channels and if you want to be notified, then clickEdit Notification Channels and add your notification channels. Return to theAlerting page after you add your channels.
  3. From theAlerting page, selectCreate policy.
  4. To select the resource, metric, and filters, expand theSelect a metric menu and then use the values in theNew condition table:
    1. Optional: To limit the menu to relevant entries, enter the resource or metric name in the filter bar.
    2. Select aResource type. For example, selectVM instance.
    3. Select aMetric category. For example, selectinstance.
    4. Select aMetric. For example, selectCPU Utilization.
    5. SelectApply.
  5. ClickNext and then configure the alerting policy trigger. To complete these fields, use the values in theConfigure alert trigger table.
  6. ClickNext.
  7. Optional: To add notifications to your alerting policy, clickNotification channels. In the dialog, select one or more notification channels from the menu, and then clickOK.

    To be notified when incidents are openend and closed, checkNotify on incident closure. By default, notifications are sent only when incidents are openend.

  8. Optional: Update theIncident autoclose duration. This field determines when Monitoring closes incidents in the absence of metric data.
  9. Optional: ClickDocumentation, and then add any information that you want included in a notification message.
  10. ClickAlert name and enter a name for the alerting policy.
  11. ClickCreate Policy.
New condition
Field

Value
Resource and MetricIn theResources menu, selectConsumed API.
In theMetric categories menu, selectApi.
In theMetrics menu, selectRequest count.

(The metric.type isserviceruntime.googleapis.com/api/request_count).
Filterservice = cloudtrace.googleapis.com
response_code = 429
Across time series
Time series aggregation
sum
Rolling window1 m
Rolling window functionsum
Configure alert trigger
Field

Value
Condition typeThreshold
Alert triggerAny time series violates
Threshold positionAbove threshold
Threshold value0
Retest window1 minute

Monitor monthly span ingestion

To create an alerting policy that triggers when your monthlyCloud Trace spans ingested exceeds a user-defined limit, use the following settings.

Steps to create an alerting policy.

To create an alerting policy, do the following:

  1. In the Google Cloud console, go to the Alerting page:

    Go toAlerting

    If you use the search bar to find this page, then select the result whose subheading isMonitoring.

  2. If you haven't created your notification channels and if you want to be notified, then clickEdit Notification Channels and add your notification channels. Return to theAlerting page after you add your channels.
  3. From theAlerting page, selectCreate policy.
  4. To select the resource, metric, and filters, expand theSelect a metric menu and then use the values in theNew condition table:
    1. Optional: To limit the menu to relevant entries, enter the resource or metric name in the filter bar.
    2. Select aResource type. For example, selectVM instance.
    3. Select aMetric category. For example, selectinstance.
    4. Select aMetric. For example, selectCPU Utilization.
    5. SelectApply.
  5. ClickNext and then configure the alerting policy trigger. To complete these fields, use the values in theConfigure alert trigger table.
  6. ClickNext.
  7. Optional: To add notifications to your alerting policy, clickNotification channels. In the dialog, select one or more notification channels from the menu, and then clickOK.

    To be notified when incidents are openend and closed, checkNotify on incident closure. By default, notifications are sent only when incidents are openend.

  8. Optional: Update theIncident autoclose duration. This field determines when Monitoring closes incidents in the absence of metric data.
  9. Optional: ClickDocumentation, and then add any information that you want included in a notification message.
  10. ClickAlert name and enter a name for the alerting policy.
  11. ClickCreate Policy.
New condition
Field

Value
Resource and MetricIn theResources menu, selectGlobal.
In theMetric categories menu, selectBilling.
In theMetrics menu, selectMonthly trace spans ingested.
Filter
Across time series
Time series aggregation
sum
Rolling window60 m
Rolling window functionmax
Configure alert trigger
Field

Value
Condition typeThreshold
Alert triggerAny time series violates
Threshold positionAbove threshold
Threshold valueYou determine the acceptable value.
Retest windowMinimum acceptable value is 30 minutes.

Monitor rate of span ingestion

You can also monitor the rate at which spans are ingested. For this case,you want to select the metric typeTrace spans ingested. The defaultsettings in theTransform data andAcross time series sections areappropriate for this metric type.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-18 UTC.