forked from kubernetes/test-infra
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#15240 from hongkailiu/ghproxyAlerts
Add alerts for ghproxy
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
prow/cluster/monitoring/mixins/prometheus/ghproxy_alerts.libsonnet
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
prometheusAlerts+:: { | ||
groups+: [ | ||
{ | ||
name: 'ghproxy', | ||
rules: [ | ||
{ | ||
alert: 'ghproxy-status-code-abnormal-%sXX' % code_prefix, | ||
// excluding 404 because it does not indicate any error in the system | ||
expr: ||| | ||
sum(rate(github_request_duration_count{status=~"%s..", status!="404"}[5m])) / sum(rate(github_request_duration_count{status!="404"}[5m])) * 100 > 5 | ||
||| % code_prefix, | ||
'for': '1m', | ||
labels: { | ||
severity: 'slack', | ||
}, | ||
annotations: { | ||
message: 'ghproxy has {{ $value | humanize }}%% of status code %sXX for over 1 minute.' % code_prefix, | ||
}, | ||
} | ||
for code_prefix in ['4', '5'] | ||
] + | ||
[ | ||
{ | ||
alert: 'ghproxy-running-out-github-tokens-in-a-hour', | ||
// check 30% of the capacity (5000): 1500 | ||
expr: ||| | ||
github_token_usage{job="ghproxy"} < 1500 | ||
and | ||
predict_linear(github_token_usage{job="ghproxy"}[1h], 1 * 3600) < 0 | ||
|||, | ||
'for': '5m', | ||
labels: { | ||
severity: 'slack', | ||
}, | ||
annotations: { | ||
message: 'token {{ $labels.token_hash }} will run out of API quota before the next reset.', | ||
}, | ||
} | ||
], | ||
}, | ||
], | ||
}, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
(import 'ci_absent_alerts.libsonnet') + | ||
(import 'prow_monitoring_absent_alerts.libsonnet') + | ||
(import 'configmap_alerts.libsonnet') + | ||
(import 'ghproxy_alerts.libsonnet') + | ||
(import 'hook_alert.libsonnet') + | ||
(import 'sinker_alerts.libsonnet') + | ||
(import 'tide_alerts.libsonnet') |