Monitor trace quota usage and spans ingested

You can create alerting policies in Cloud Monitoring to monitor the number of Cloud Trace spans ingested per month, your quota usage, and your rate of span ingestion. If you have never created an alerting policy, see Managing alerting policies for detailed information about using the Cloud Monitoring console.

Monitor over-quota on Cloud Trace API usage

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

alerting policy.

To create an alerting policy, do the following:

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

    Go to Alerting

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

  2. If you haven't created your notification channels and if you want to be notified, then click Edit Notification Channels and add your notification channels. Return to the Alerting page after you add your channels.
  3. From the Alerting page, select Create policy.
  4. To select the resource, metric, and filters, expand the Select a metric menu and then use the values in the New condition table:
    1. Optional: To limit the menu to relevant entries, enter the resource or metric name in the filter bar.
    2. Select a Resource type. For example, select VM instance.
    3. Select a Metric category. For example, select instance.
    4. Select a Metric. For example, select CPU Utilization.
    5. Select Apply.
  5. Click Next and then configure the alerting policy trigger. To complete these fields, use the values in the Configure alert trigger table.
  6. Click Next.
  7. Optional: To add notifications to your alerting policy, click Notification channels. In the dialog, select one or more notification channels from the menu, and then click OK.

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

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

Value
Resource and Metric In the Resources menu, select Consumed API.
In the Metric categories menu, select Api.
In the Metrics menu, select Request count.

(The metric.type is serviceruntime.googleapis.com/api/request_count).
Filter service = cloudtrace.googleapis.com
response_code = 429
Across time series
Time series aggregation
sum
Rolling window 1 m
Rolling window function sum
Configure alert trigger
Field

Value
Condition type Threshold
Alert trigger Any time series violates
Threshold position Above threshold
Threshold value 0
Retest window 1 minute

Monitor monthly span ingestion

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

alerting policy.

To create an alerting policy, do the following:

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

    Go to Alerting

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

  2. If you haven't created your notification channels and if you want to be notified, then click Edit Notification Channels and add your notification channels. Return to the Alerting page after you add your channels.
  3. From the Alerting page, select Create policy.
  4. To select the resource, metric, and filters, expand the Select a metric menu and then use the values in the New condition table:
    1. Optional: To limit the menu to relevant entries, enter the resource or metric name in the filter bar.
    2. Select a Resource type. For example, select VM instance.
    3. Select a Metric category. For example, select instance.
    4. Select a Metric. For example, select CPU Utilization.
    5. Select Apply.
  5. Click Next and then configure the alerting policy trigger. To complete these fields, use the values in the Configure alert trigger table.
  6. Click Next.
  7. Optional: To add notifications to your alerting policy, click Notification channels. In the dialog, select one or more notification channels from the menu, and then click OK.

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

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

Value
Resource and Metric In the Resources menu, select Global.
In the Metric categories menu, select Billing.
In the Metrics menu, select Monthly trace spans ingested.
Filter
Across time series
Time series aggregation
sum
Rolling window 60 m
Rolling window function max
Configure alert trigger
Field

Value
Condition type Threshold
Alert trigger Any time series violates
Threshold position Above threshold
Threshold value You determine the acceptable value.
Retest window Minimum 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 type Trace spans ingested. The default settings in the Transform data and Across time series sections are appropriate for this metric type.