Last active
November 12, 2021 16:56
-
-
Save yuriatgoogle/bb9d128c8ac3e07255e104efcf9dfdee to your computer and use it in GitHub Desktop.
GCS Egress Quota Use Ratio - MQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch consumer_quota | |
| filter resource.service == 'storage.googleapis.com' | |
| { metric serviceruntime.googleapis.com/quota/rate/net_usage | |
| align rate(1m) | |
| group_by [resource.project_id, metric.quota_metric, resource.location], | |
sum(value.net_usage) | |
| cast_units('1') | |
; metric serviceruntime.googleapis.com/quota/limit | |
| filter metric.limit_name == 'GoogleEgressBandwidth' | |
| group_by [resource.project_id, metric.quota_metric, resource.location], | |
sliding(1m), max(val()) } | |
| ratio | |
| every 1m | |
| condition gt(val(), 0.8 '1') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch consumer_quota | |
| { metric serviceruntime.googleapis.com/quota/rate/net_usage | |
| filter | |
(metric.quota_metric == 'storage.googleapis.com/google_egress_bandwidth') | |
| align rate(1m) | |
| every 1m | |
| group_by [resource.location], [value_net_usage_max: max(value.net_usage)] | |
; metric serviceruntime.googleapis.com/quota/limit | |
| filter metric.limit_name == 'GoogleEgressBandwidth' | |
| group_by 1m, [value_limit_mean: mean(value.limit)] | |
| every 1m | |
| group_by [resource.location], [value_limit_mean_max: max(value_limit_mean)] } | |
| ratio | |
| every 1m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment