Skip to content

Commit 6fe0ed2

Browse files
authored
Fix quotes in Prometheus alert expressions
1 parent df43f79 commit 6fe0ed2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coder-observability/templates/_prometheus-alerts.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
rules:
219219
{{ $alert := "PostgresDown" }}
220220
- alert: {{ $alert }}
221-
expr: pg_up{namespace={{ .Release.Namespace }}} == 0
221+
expr: pg_up{namespace="{{ .Release.Namespace }}"} == 0
222222
for: {{ $group.delay }}
223223
annotations:
224224
summary: The postgres instance {{ `{{ $labels.instance }}` }} is down!
@@ -235,7 +235,7 @@
235235
{{ $alert := "PostgresConnectionsRunningLow" }}
236236
{{- range $severity, $threshold := .thresholds }}
237237
- alert: {{ $alert }}
238-
expr: sum by (datname, instance) (pg_stat_activity_count{namespace={{ .Release.Namespace }}}) > on () group_left() (pg_settings_max_connections{namespace={{ .Release.Namespace }}} * {{ $threshold }})
238+
expr: sum by (datname, instance) (pg_stat_activity_count{namespace="{{ .Release.Namespace }}"}) > on () group_left() (pg_settings_max_connections{namespace="{{ .Release.Namespace }}"} * {{ $threshold }})
239239
for: {{ $group.delay }}
240240
labels:
241241
summary: The postgres instance {{ `{{ $labels.instance }}` }} is running low on connections which may impact application performance.

0 commit comments

Comments
 (0)