Skip to content

Conversation

@kshk123
Copy link
Owner

@kshk123 kshk123 commented Nov 26, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 26, 2025 20:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.params from 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
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
reducer = "last" # Take the most recent value

Copilot uses AI. Check for mistakes.

# Query B: Threshold check
# Query B: Check if speed < threshold
# This reduces Query A to the last value and evaluates: is it < 63?
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
# 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)

Copilot uses AI. Check for mistakes.
@kshk123 kshk123 merged commit 8ac9933 into main Nov 26, 2025
1 check passed
@kshk123 kshk123 deleted the fix-alert-query branch November 26, 2025 20:57
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