alerting: don't print a bare "value:" when ValueString is empty (#96)
All checks were successful
secrets-guard / encrypted (push) Successful in 14s
Validate observability stack / validate (push) Successful in 17s
secrets-guard / encrypted (pull_request) Successful in 5s
shell-lint / shellcheck (push) Successful in 14s
PR build (required check) / validate-observability (pull_request) Successful in 20s
PR build (required check) / changes (pull_request) Successful in 8s
shell-lint / shellcheck (pull_request) Successful in 6s
PR build (required check) / build-backend (pull_request) Has been skipped
PR build (required check) / build-frontend (pull_request) Has been skipped
PR build (required check) / gate (pull_request) Successful in 2s
All checks were successful
secrets-guard / encrypted (push) Successful in 14s
Validate observability stack / validate (push) Successful in 17s
secrets-guard / encrypted (pull_request) Successful in 5s
shell-lint / shellcheck (push) Successful in 14s
PR build (required check) / validate-observability (pull_request) Successful in 20s
PR build (required check) / changes (pull_request) Successful in 8s
shell-lint / shellcheck (pull_request) Successful in 6s
PR build (required check) / build-backend (pull_request) Has been skipped
PR build (required check) / build-frontend (pull_request) Has been skipped
PR build (required check) / gate (pull_request) Successful in 2s
This commit is contained in:
parent
1a56a63800
commit
b32b5841f3
1 changed files with 16 additions and 2 deletions
|
|
@ -37,12 +37,26 @@ contactPoints:
|
|||
# Deliberately plain. A template error here breaks EVERY notification
|
||||
# silently, so this uses only functions verified against Grafana
|
||||
# 11.6.1 via /api/alertmanager/grafana/config/api/v1/receivers/test.
|
||||
#
|
||||
# `.ValueString` is guarded because it is not always populated. It
|
||||
# carries the evaluated refIds only when the notification came from an
|
||||
# evaluation that produced them; an instance resolved by Grafana's
|
||||
# STALENESS handling — no evaluation ever returns it again, so the
|
||||
# state manager expires it — resolves with an empty ValueString. That
|
||||
# happens whenever a rule's `title` changes, since the title becomes
|
||||
# the alertname label and the old label set is orphaned. Renaming
|
||||
# ProdWorkerContainerSilent -> ProdWorkerHeartbeatMissing on
|
||||
# 2026-07-25 did exactly that and posted a resolved notice reading
|
||||
# "value:" with nothing after it. An empty labelled field is worse
|
||||
# than an absent one: it reads as a value that failed to compute.
|
||||
# Unguarded `{{ .ValueString }}` on its own would be safe; printing
|
||||
# the label unconditionally is the bug.
|
||||
message: |-
|
||||
{{ range .Alerts }}**severity:** {{ .Labels.severity }} · **host:** {{ .Labels.host }}
|
||||
{{ .Annotations.summary }}
|
||||
{{ .Annotations.description }}
|
||||
`value: {{ .ValueString }}`
|
||||
{{ end }}
|
||||
{{ if .ValueString }}`value: {{ .ValueString }}`
|
||||
{{ end }}{{ end }}
|
||||
<https://dashboard.thermograph.org/alerting/list>
|
||||
|
||||
# --- The factory-default contact point -------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue