Skip to content

Commit

Permalink
Improve promtail alerts to retain the namespace label (#2976)
Browse files Browse the repository at this point in the history
The `PromtailFileMissing` should actually work in this simplified
form. Please let me know if I'm missing something.
  • Loading branch information
beorn7 authored Nov 24, 2020
1 parent 14a5e22 commit e14463b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions production/promtail-mixin/alerts.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
alert: 'PromtailRequestLatency',
expr: |||
job_status_code:promtail_request_duration_seconds:99quantile > 1
job_status_code_namespace:promtail_request_duration_seconds:99quantile > 1
|||,
'for': '15m',
labels: {
Expand Down Expand Up @@ -55,7 +55,7 @@
{
alert: 'PromtailFileMissing',
expr: |||
count by (path,instance,job) (promtail_file_bytes_total) unless count by (path,instance,job) (promtail_read_bytes_total)
promtail_file_bytes_total unless promtail_read_bytes_total
|||,
'for': '15m',
labels: {
Expand Down
4 changes: 2 additions & 2 deletions production/promtail-mixin/recording_rules.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
groups+: [{
name: 'promtail_rules',
rules:
utils.histogramRules('promtail_request_duration_seconds', ['job']) +
utils.histogramRules('promtail_request_duration_seconds', ['job', 'status_code']),
utils.histogramRules('promtail_request_duration_seconds', ['job', 'namespace']) +
utils.histogramRules('promtail_request_duration_seconds', ['job', 'status_code', 'namespace']),
}],
},
}

0 comments on commit e14463b

Please sign in to comment.