您可以在 Cloud Monitoring 中创建提醒政策来监控每月提取的 Cloud Trace span 数量、配额用量以及 span 提取率。如果您从未创建过提醒政策,请参阅管理提醒政策,详细了解如何使用 Cloud Monitoring 控制台。
跟踪 API 使用配额
如需创建一项提醒政策,并在您的月度 Cloud Trace span 提取量超过您的配额时触发,请使用以下设置:
目标窗格 字段 |
值 |
---|---|
Resource type |
Consumed API |
Metric |
Request count |
Filter |
service = cloudtrace.googleapis.com |
Aggregator |
sum |
Period |
1 m |
Advanced Aggregation |
Aligner :sum |
配置窗格 字段 |
值 |
---|---|
Condition triggers if |
Any time series violates |
Condition |
is above |
Threshold |
0 |
For |
1 minute |
跟踪监控每月 span 用量
如需创建一项提醒政策,并在您的月度 Cloud Trace span 提取量超过用户定义的限制时触发,请使用以下设置:
目标窗格 字段 |
值 |
---|---|
Resource type |
global |
Metric |
Monthly trace spans ingested |
Filter |
|
Aggregator |
sum |
Period |
60 m |
Advanced Aggregation |
Aligner :max |
配置窗格 字段 |
值 |
---|---|
Condition triggers if |
Any time series violates |
Condition |
is above |
Threshold |
可接受的值由您决定。 |
For |
可接受的最小值是 30 分钟。 |