Emit first-party cluster-health metrics and ship a default alert-rule set in the Helm chart
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- go, helm, kubernetes, prometheus
调研方向
Start with the EtcdCluster reconcile loop and the existing controller-runtime metrics wiring, then read the chart's ServiceMonitor template and issue #343 for the AllMembersLost state. Metric names are a strawman, so agree them with maintainers first. Done means the per-cluster metrics are exported and a PrometheusRule is rendered only when alerts.enabled is set. This is design-heavy, so ask before implementing.
由索引模型根据 Issue 内容生成。
描述
The operator currently exposes only stock controller-runtime metrics — the chart ships a ServiceMonitor, and the Cozystack packaging adds a VMServiceScrape, so the scrape surface exists — but no first-party health metrics and no alerting rules. That combination leaves the most damaging failure mode invisible: as #343 established, a cluster can enter a state the reconciler can never leave (e.g. scaleUp with zero live endpoints while status.clusterID is latched), and the loop retries forever while status.conditions keeps reporting Available=True. Anything watching conditions sees green; the only truthful signal is the reconcile loop itself.
Proposal, in two halves:
1. First-party metrics
Per EtcdCluster, labelled namespace/name (names are a strawman):
etcd_operator_cluster_members_desired/_members_ready/_members_learnersetcd_operator_cluster_quorum— 0/1 as currently probed by the operator, not as latched in statusetcd_operator_cluster_condition{condition=...}— terminal/degraded states (AllMembersLostfrom #343,BootstrapFailed, …)etcd_operator_cluster_last_successful_reconcile_timestamp_seconds— the anti-lying heartbeat: consumers alert on its age instead of trusting conditions
2. A default alert-rule set shipped by the Helm chart
Values-gated (e.g. alerts.enabled), following the pattern cloudnative-pg and piraeus charts already use — the chart ships the rules, the cluster's evaluator just selects them:
- Reconcile-error streak:
rate(controller_runtime_reconcile_errors_total{controller=~"etcdcluster.*"}[10m]) > 0sustained 1h → warning, 6h → critical. Catches every wedged-forever class, including the #343 one, on day one — no new instrumentation needed. - Terminal/degraded condition present → critical immediately.
members_ready < members_desiredfor 15m → critical.quorum == 0for 5m → critical.time() - last_successful_reconcile > 1hper cluster → warning.
The upstream chart already ships prometheus-operator kinds (ServiceMonitor), so PrometheusRule fits there; victoria-metrics-operator conversion makes it consumable in Cozystack deployments, or the Cozystack package can mirror it as a VMRule next to its existing VMServiceScrape.
Separable follow-up: the operator holds the client TLS material for the etcd clusters it manages, so it is also the natural place to optionally render a per-cluster scrape plus the standard etcd data-plane rules (leader changes, fsync latency, db size vs quota). The five rules above don't depend on it.
- 主要语言
- Go
- 星标
- 154
- 派生
- 31
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cozystack/etcd-operator 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
cozystack/etcd-operator#385 ·
-
难度 5/5 一周以上 新手友好度 35/100
cozystack/etcd-operator#383 ·
-
难度 5/5 一周以上 新手友好度 15/100
cozystack/etcd-operator#381 ·
-
难度 4/5 3-5 天 新手友好度 35/100
cozystack/etcd-operator#374 · 1 条评论 ·
-
Adoption deletes the legacy cluster-state ConfigMap but leaves Pods referencing it, and neither self-heal path detects the result可能已有人在做 @androndo 于 46 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 35/100
cozystack/etcd-operator#373 ·
查看 cozystack/etcd-operator 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
Correct local module testing instructions for Go sample contributors可能已有人在做 @slievrly 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
-
internal/core: cleanAttachmentName splits a rune at the 255-byte cap and stores invalid UTF-8可能已有人在做 @pacwestnobody 今天认领。 未关闭go good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
TestLaunchGolden spends about 98 seconds on fake-agent exit delays under -race可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
factory:subtask
难度 1/5 1 小时以内 新手友好度 95/100
维护者通常 1 天内回复