Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a download speed alert query in Grafana Cloud by changing Query B from a "reduce" operation to a "threshold" evaluation. The change aims to properly evaluate whether the download speed falls below the configured threshold (63 Mbps) and includes detailed inline comments explaining the query logic.
Key changes:
- Changed Query B type from "reduce" to "threshold" for proper condition evaluation
- Updated
query.paramsfrom empty array to["A"]to reference Query A - Added comprehensive inline comments explaining the threshold evaluation logic
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| expression = "A" | ||
| reducer = "last" | ||
| expression = "A" # Input: Query A (the speed metric) | ||
| reducer = "last" # Take the most recent value |
There was a problem hiding this comment.
The configuration has reducer = "last" at the top level (line 177) combined with type = "threshold" (line 179). In Grafana's unified alerting, the threshold type uses a classic condition format where the reducer is specified within the conditions[].reducer block (lines 192-195), not at the top level. The top-level reducer field should be removed when using type = "threshold", as it conflicts with the threshold expression format.
| reducer = "last" # Take the most recent value |
|
|
||
| # Query B: Threshold check | ||
| # Query B: Check if speed < threshold | ||
| # This reduces Query A to the last value and evaluates: is it < 63? |
There was a problem hiding this comment.
The comment states "This reduces Query A to the last value" but the query type is now "threshold", not "reduce". The threshold type evaluates a condition (in this case, whether the value is less than the threshold). Consider updating the comment to: "This evaluates if Query A's last value is below the threshold" to accurately reflect what a threshold query does.
| # This reduces Query A to the last value and evaluates: is it < 63? | |
| # This evaluates if Query A's last value is below the threshold (63 Mbps) |
No description provided.