prometheus: remove escaping

This commit is contained in:
zowoq 2023-11-07 10:54:42 +10:00
parent b93f9eec50
commit f1d59d1f21

View File

@ -2,12 +2,12 @@
srvos.prometheus.ruleGroups.srvosAlerts = { srvos.prometheus.ruleGroups.srvosAlerts = {
alertRules = { alertRules = {
MonitoringTooManyRestarts = { MonitoringTooManyRestarts = {
expr = "changes(process_start_time_seconds{job=~\"prometheus|pushgateway|alertmanager|telegraf\"}[15m]) > 2"; expr = ''changes(process_start_time_seconds{job=~"prometheus|pushgateway|alertmanager|telegraf"}[15m]) > 2'';
annotations.description = "Service has restarted more than twice in the last 15 minutes. It might be crashlooping"; annotations.description = "Service has restarted more than twice in the last 15 minutes. It might be crashlooping";
}; };
AlertManagerConfigNotSynced = { AlertManagerConfigNotSynced = {
expr = "count(count_values(\"config_hash\", alertmanager_config_hash)) > 1"; expr = ''count(count_values("config_hash", alertmanager_config_hash)) > 1'';
annotations.description = "Configurations of AlertManager cluster instances are out of sync"; annotations.description = "Configurations of AlertManager cluster instances are out of sync";
}; };
@ -28,9 +28,9 @@
}; };
PromtailRequestsErrors = { PromtailRequestsErrors = {
expr = "100 * sum(rate(promtail_request_duration_seconds_count{status_code=~\"5..|failed\"}[1m])) by (namespace, job, route, instance) / sum(rate(promtail_request_duration_seconds_count[1m])) by (namespace, job, route, instance) > 10"; expr = ''100 * sum(rate(promtail_request_duration_seconds_count{status_code=~"5..|failed"}[1m])) by (namespace, job, route, instance) / sum(rate(promtail_request_duration_seconds_count[1m])) by (namespace, job, route, instance) > 10'';
for = "15m"; for = "15m";
annotations.description = "{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf \"%.2f\" $value }}% errors"; annotations.description = ''{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}% errors'';
}; };
PromtailFileLagging = { PromtailFileLagging = {
@ -115,7 +115,7 @@
}; };
TelegrafDown = { TelegrafDown = {
expr = "min(up{job=~\"telegraf\",type!='mobile'}) by (source, job, instance, org) == 0"; expr = ''min(up{job=~"telegraf",type!='mobile'}) by (source, job, instance, org) == 0'';
for = "3m"; for = "3m";
annotations.description = "{{$labels.instance}}: telegraf exporter from {{$labels.instance}} is down"; annotations.description = "{{$labels.instance}}: telegraf exporter from {{$labels.instance}} is down";
}; };
@ -222,7 +222,7 @@
}; };
AlertmanagerSilencesChanged = { AlertmanagerSilencesChanged = {
expr = "abs(delta(alertmanager_silences{state=\"active\"}[1h])) >= 1"; expr = ''abs(delta(alertmanager_silences{state="active"}[1h])) >= 1'';
annotations.description = "alertmanager: number of active silences has changed: {{$value}}"; annotations.description = "alertmanager: number of active silences has changed: {{$value}}";
}; };
}; };