Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config/observability-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ rules:
severity: page
query_language: promql
stream_name: gha_fleet_diagnostic_export_consecutive_failures
expression: max by (host_name) (gha_fleet_diagnostic_export_consecutive_failures)
# One exporter series exists, already labeled with its host. Aggregating it
# before the sustained range turns an empty input into a scalar on
# OpenObserve v1 and makes the subquery fail instead of reporting healthy.
expression: gha_fleet_diagnostic_export_consecutive_failures
operator: ">"
threshold: 0
evaluation_seconds: 30
Expand Down
3 changes: 2 additions & 1 deletion internal/observabilityrules/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ func TestDiagnosticExporterPageRequiresSustainedFailure(t *testing.T) {
}
for _, alert := range rendered.Alerts {
if alert.Name == rule.ID && (rule.HoldSecs != 180 || alert.TriggerCondition.Threshold != 1 ||
!strings.HasPrefix(withoutSubject(alert.QueryCondition.PromQL), "min_over_time(")) {
!strings.HasPrefix(withoutSubject(alert.QueryCondition.PromQL),
"min_over_time((gha_fleet_diagnostic_export_consecutive_failures)")) {
t.Fatalf("diagnostic rule=%#v alert=%#v", rule, alert)
}
}
Expand Down