-
Notifications
You must be signed in to change notification settings - Fork 2.6k
added md disks in down state #3007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 8 commits
21be960
58f48d1
27b93f8
3179601
f21e3b5
dd0a449
70a889f
9b3de10
4d743c4
6df2222
cf0dffe
af65f85
de82d1a
e020eb4
01a9d66
5586487
847e8ca
1d11514
626fd3f
bcbe1d7
843a753
0840dde
eb7055d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -99,6 +99,24 @@ var ( | |||||||||||||
| []string{"device"}, | ||||||||||||||
| nil, | ||||||||||||||
| ) | ||||||||||||||
| blocksSyncedPctDesc = prometheus.NewDesc( | ||||||||||||||
| prometheus.BuildFQName(namespace, "md", "blocks_synced_pct"), | ||||||||||||||
| "Percentage of blocks synced on device.", | ||||||||||||||
| []string{"device"}, | ||||||||||||||
| nil, | ||||||||||||||
| ) | ||||||||||||||
| syncTimeRemainingDesc = prometheus.NewDesc( | ||||||||||||||
| prometheus.BuildFQName(namespace, "md", "sync_time_remaining"), | ||||||||||||||
Finomosec marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||
| "Estimated finishing time for current sync in seconds.", | ||||||||||||||
| []string{"device"}, | ||||||||||||||
| nil, | ||||||||||||||
| ) | ||||||||||||||
| blockSyncedSpeedDesc = prometheus.NewDesc( | ||||||||||||||
| prometheus.BuildFQName(namespace, "md", "blocks_synced_speed"), | ||||||||||||||
| "current sync speed (in Kilobytes/sec)", | ||||||||||||||
| []string{"device"}, | ||||||||||||||
| nil, | ||||||||||||||
| ) | ||||||||||||||
|
Comment on lines
+123
to
+128
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem necessary, we should be able to compute this from something like
Suggested change
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is usefull. It is the CURRENT speed, as it is shown in /stat/proc/mdstat
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My Grafana Board: https://grafana.com/grafana/dashboards/20989-node-exporter-mdadm-status/
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that the groundwork has already been laid for #1085, and we probably should not add any new parsing functionality relating to |
||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| func (c *mdadmCollector) Update(ch chan<- prometheus.Metric) error { | ||||||||||||||
|
|
@@ -131,7 +149,13 @@ func (c *mdadmCollector) Update(ch chan<- prometheus.Metric) error { | |||||||||||||
| float64(mdStat.DisksTotal), | ||||||||||||||
| mdStat.Name, | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| ch <- prometheus.MustNewConstMetric( | ||||||||||||||
| disksDesc, | ||||||||||||||
| prometheus.GaugeValue, | ||||||||||||||
| float64(mdStat.DisksDown), | ||||||||||||||
| mdStat.Name, | ||||||||||||||
| "down", | ||||||||||||||
| ) | ||||||||||||||
| ch <- prometheus.MustNewConstMetric( | ||||||||||||||
| disksDesc, | ||||||||||||||
| prometheus.GaugeValue, | ||||||||||||||
|
|
@@ -200,6 +224,25 @@ func (c *mdadmCollector) Update(ch chan<- prometheus.Metric) error { | |||||||||||||
| float64(mdStat.BlocksSynced), | ||||||||||||||
| mdStat.Name, | ||||||||||||||
| ) | ||||||||||||||
| ch <- prometheus.MustNewConstMetric( | ||||||||||||||
| blocksSyncedPctDesc, | ||||||||||||||
| prometheus.GaugeValue, | ||||||||||||||
| float64(mdStat.BlocksSyncedPct), | ||||||||||||||
| mdStat.Name, | ||||||||||||||
| ) | ||||||||||||||
| ch <- prometheus.MustNewConstMetric( | ||||||||||||||
| syncTimeRemainingDesc, | ||||||||||||||
| prometheus.GaugeValue, | ||||||||||||||
| float64(mdStat.BlocksSyncedFinishTime*60), | ||||||||||||||
| mdStat.Name, | ||||||||||||||
| ) | ||||||||||||||
| ch <- prometheus.MustNewConstMetric( | ||||||||||||||
| blockSyncedSpeedDesc, | ||||||||||||||
| prometheus.GaugeValue, | ||||||||||||||
| float64(mdStat.BlocksSyncedSpeed), | ||||||||||||||
| mdStat.Name, | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| return nil | ||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.