Skip to content

Conversation

mrsillydog
Copy link
Contributor

This PR updates Google GCE alerts to use PromQL instead of the deprecated MQL.

Note that we included on (reservation_id) in the PromQL versions of the query, which is not a part of the original MQL. This is because without the inclusion of this expression, the PromQL data does not appear; see the screenshots for an example.

image image

MQL:
image

PromQL:
image

"displayName": "High Reservation Utilization",
"conditionPrometheusQueryLanguage": {
"duration": "0s",
"evaluationInterval": "300s",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be swapped - evaluation interval 60s duration 300s
I believe the intention was to only fire if used/reserved is true for 5 minutes. and this metric is emitted every 60s

"conditionPrometheusQueryLanguage": {
"duration": "0s",
"evaluationInterval": "300s",
"query": "count_over_time(\n (\n ({\"compute.googleapis.com/reservation/used\", monitored_resource=\"compute.googleapis.com/Reservation\"}\n / on (reservation_id)\n {\"compute.googleapis.com/reservation/reserved\", monitored_resource=\"compute.googleapis.com/Reservation\"}\n ) <= 0.1\n )[23h:5m]\n) > (20 * 12) # 20 hours * (12 5 min intervals in hour)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right to me but I'd like joshuapollock@ to take a look

@mrsillydog mrsillydog requested a review from lyanco September 22, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants