node_systemd_unit_state metrics silently ignores units that systemd failed to load
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- go
调研方向
从 collector/systemd_linux.go 中第 494-499 行附近的过滤逻辑开始,然后阅读引入该逻辑的关联 commit。确定加载失败的单元是否应直接报告,还是应由 CLI 标志控制,并验证生成的指标包含加载状态不是 loaded 的单元。
由索引模型根据 Issue 内容生成。
描述
Systemd units have two status fields, "load state" and "active state". Node Exporter only reports on active state. If a unit has any load state other than "loaded" it is silently ignored (unless debug logging is enabled, but it still does not appear in metrics).
Practical example: if a .timer unit has an invalid OnCalendar value (if like me you mistakenly assumed it would support typical crontab syntax), then the timer will fail to load and never be reported in any metrics by Node Exporter.
This filtering is done here: https://github.com/prometheus/node_exporter/blob/2179f0a34d2d7b6212f3a1c647d5aca44ffa33e5/collector/systemd_linux.go#L494-L499
It was added in this commit: https://github.com/prometheus/node_exporter/commit/0fdc089187c3d5d9fe62e528653986ee6e71325b
I am not sure why this filter was added, but i feel that being able to alert on units that failed to load would be a useful safety feature. Could this filter either be removed or controlled by a CLI flag?
Thanks!
- 主要语言
- Go
- 星标
- 13.8k
- 派生
- 2.7k
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 7
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
prometheus/node_exporter 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
prometheus/node_exporter#3830 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
prometheus/node_exporter#3823 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
prometheus/node_exporter#3817 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
prometheus/node_exporter#3761 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
prometheus/node_exporter#1767 ·
维护者通常 1 天内回复
查看 prometheus/node_exporter 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 92/100
MagaluCloud/terraform-provider-mgc#323 ·
维护者通常 11 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
rossoctl/context-guru#366 ·
维护者通常 1 天内回复
-
stage-fail
难度 2/5 1-3 小时 新手友好度 72/100
siyuan-note/bazaar#2293 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
piraeusdatastore/piraeus-operator#1070 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复