featurecontrol: feature-flag activation is logged at WARN, so a clean start-up emits warnings

Aperta Adatta ai principianti
#5,412 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

  • #5415 di @byBrodowski — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
go

Direzione di ricerca

Inizia da featurecontrol/featurecontrol.go e rivedi le chiamate a logger.Warn per ogni attivazione di feature flag, separando le funzionalità stabili richieste dai flag i cui messaggi contengono un avviso operativo. Il lavoro è completato quando le attivazioni stabili vengono registrate a livello INFO, mentre i flag con cardinalità illimitata rimangono a livello WARN, e un avvio pulito non produce più avvisi per i flag stabili richiesti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What did you do?

Started Alertmanager v0.33.1 with three feature flags that are required for correct operation in our
deployment:

--enable-feature=utf8-strict-mode,auto-gomemlimit,receiver-name-in-metrics
What did you expect to see?

A clean start-up log. Enabling a flag we asked for is an acknowledgement, not a warning.

What did you see instead?

Every one of the three activations is logged at WARN, so a healthy start-up emits three warning
lines and nothing else notable:

{"time":"2026-07-30T11:27:37.086790131Z","level":"WARN","source":"featurecontrol.go:160","msg":"UTF-8 strict mode enabled"}
{"time":"2026-07-30T11:27:37.086818731Z","level":"WARN","source":"featurecontrol.go:163","msg":"Automatically set GOMEMLIMIT to match the Linux container or system memory limit."}
{"time":"2026-07-30T11:27:37.086873731Z","level":"WARN","source":"featurecontrol.go:151","msg":"Experimental receiver name in metrics enabled"}

In featurecontrol/featurecontrol.go at v0.33.1 every branch uses logger.Warn(...)
unconditionally — alert-names-in-metrics, receiver-name-in-metrics, group-key-in-metrics,
classic-mode, utf8-strict-mode, auto-gomemlimit and event-recorder. There is no level
override and no way to reach the same functionality without the line.

Why this matters beyond tidiness

level=WARN is what monitoring and log pipelines are configured to escalate on. A component that
emits warnings on every clean start teaches its operators that its warnings are noise — and the one
warning that matters here is the delivery-failure retry line, which is also the line that leaks the
Telegram bot token (see #5254). Anything that trains a reader to skip Alertmanager's warnings makes
that worse.

Two of the three flags above are not even experimental in effect: auto-gomemlimit is how the Go
heap learns about a container memory limit, and running without it in a limited container is the
worse choice. Announcing the safer configuration as a warning inverts the signal.

Suggested change

Log the activation of a stable, deliberately requested feature at INFO. Keep WARN for the flags
whose message actually carries a caution — the unbounded-cardinality ones
(alert-names-in-metrics, group-key-in-metrics) have a real operational cost and deserve it.

Environment
  • Alertmanager version: 0.33.1 (revision=2c8da51e03f3dbbed24f9711ca2d76aab4eef9c5, go1.26.4,
    linux/amd64), image quay.io/prometheus/alertmanager@sha256:9e082985f56f4c8c9f724e18f2288c6708f472e56a5286b8863d080434ea065d
  • Configuration: --log.format=json --log.level=info, single replica, --cluster.listen-address=
Lingua principale
Go
Stelle
8.7k
Fork
2.5k
Merge medio
5g 21h
PR unite (30g)
43

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di prometheus/alertmanager

Tutte le issue di prometheus/alertmanager

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.