[BUG] kubernetes sync: watch errors bypass flagd's logger and metrics
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go, kubernetes
- Ambito
- backend, observability
Direzione di ricerca
Start with core/pkg/sync/kubernetes/kubernetes_sync.go around the readiness registration at line 172, then inspect where the informer is created and run. Check how flagd logging and sync error metrics are exposed, and whether SetWatchErrorHandler can be registered before Run. Done when watch failures reach flagd's logger and an appropriate metric, with tests covering the handler.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Observed behavior
When the Kubernetes sync loses its watch after startup (RBAC removed, API server unreachable), the dynamic informer retries forever. The failures are reported only by client-go through klog to stderr, for example:
Failed to watch *unstructured.Unstructured: ... featureflags.core.openfeature.dev is forbidden: User "system:serviceaccount:flagd:flagd" cannot list resource ... logger="UnhandledError"
Nothing goes through flagd's logger, and no metric changes. Combined with the latched readiness (monitoring docs), flagd keeps serving the last flags it read with no signal that the source is gone.
The sync is marked ready once, when the event handler is registered, and never cleared (kubernetes_sync.go#L172).
Expected behavior
Watch errors are logged through flagd's logger, and ideally counted in a sync error metric, so the failure can be alerted on without scraping stderr.
A possible approach: register informer.SetWatchErrorHandler (must be set before Run) to log via flagd's logger and increment a metric. The same hook could later drive readiness, if the outcome of the discussion in #2017 is that a failed sync should affect health.
Steps to reproduce
- Run flagd (v0.17.0, same code on main) with
--uri=core.openfeature.dev/<ns>/<name>and a Role granting get/list/watch onfeatureflags, bound to its service account. - Wait for
/readyzto return 200. - Delete the RoleBinding.
- The pod stays Ready; the errors appear only on stderr.
Happy to open a PR if this approach sounds right.
- Lingua principale
- Go
- Stelle
- 1k
- Fork
- 151
- Merge medio
- 5g 5h
- PR unite (30g)
- 14
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di open-feature/flagd
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
open-feature/flagd#2041 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
open-feature/flagd#2134 ·
I maintainer di solito rispondono entro 1 giorno
-
feat: bound resource usage when processing sync source payloadsForse già presa @andrearcaina l’ha presa 4 giorni fa. Apertagood first issue help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 46/100
open-feature/flagd#2133 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Targeting can't select variants whose names contain `&`, `<`, `>`, `\` or `"`Forse già presa @RaphaelFakhri l’ha presa 22 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
open-feature/flagd#2120 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
feat: consistent opt-in strict schema validation modeForse di nuovo libera @Anurag-S1ngh l’ha presa 29 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
open-feature/flagd#2112 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di open-feature/flagd
Issue simili
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Windows系统上,希望复制路径增加 Unix 格式Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
go good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Azure/prometheus-collector#1828 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni