collector/diskstats: add device-mapper backing device info metric#3676
collector/diskstats: add device-mapper backing device info metric#3676Maharacha wants to merge 4 commits into
Conversation
|
This is a great addition! Well needed! PV:s are critical to surface like this. +1 from me. |
48e8ac6 to
e59b259
Compare
|
@SuperQ - is there anything we need to do to get this into the exporter main ? |
|
@erik78se could you confirm the e2e check is green by running: |
| func (c *diskstatsCollector) updateDeviceMapperBackingDevices(ch chan<- prometheus.Metric, dev string) { | ||
| underlying, err := c.fs.SysBlockDeviceUnderlyingDevices(dev) | ||
| if err != nil { | ||
| if !os.IsNotExist(err) { |
There was a problem hiding this comment.
nit: IIRC other places we are following this style of validation.
| if !os.IsNotExist(err) { | |
| if errors.Is(err, os.ErrNotExist) |
6edfa71 to
785de74
Compare
@nicolastakashi I have updated the fixture so that |
785de74 to
9c95be2
Compare
|
@Maharacha can you fix CI? |
af6346c to
d7a6d33
Compare
I have added this d7a6d33 Can you approve workflows? |
Signed-off-by: Joakim Nyman <joakim.nyman86@gmail.com>
Signed-off-by: Joakim Nyman <joakim.nyman86@gmail.com>
…rics Signed-off-by: Joakim Nyman <joakim.nyman86@gmail.com>
Signed-off-by: Joakim Nyman <joakim.nyman86@gmail.com>
d7a6d33 to
a6446ce
Compare
| # HELP node_disk_device_mapper_backing_device_info Info about the underlying block devices of a device mapper device. | ||
| # TYPE node_disk_device_mapper_backing_device_info gauge | ||
| node_disk_device_mapper_backing_device_info{backing_device="dm-0",device="dm-1"} 1 | ||
| node_disk_device_mapper_backing_device_info{backing_device="dm-0",device="dm-2"} 1 | ||
| node_disk_device_mapper_backing_device_info{backing_device="dm-0",device="dm-3"} 1 | ||
| node_disk_device_mapper_backing_device_info{backing_device="dm-0",device="dm-4"} 1 | ||
| node_disk_device_mapper_backing_device_info{backing_device="dm-0",device="dm-5"} 1 | ||
| node_disk_device_mapper_backing_device_info{backing_device="nvme0n1p3",device="dm-0"} 1 |
There was a problem hiding this comment.
Interesting case here, if I understand it correctly, dm-1/2/3/4/5 are all created from the backing_device dm-0, and dm-0 is backed by nvme0n1p3. So operations in the disk dm-1/2/3/4/5 are all handled by nvme0n1p3 in reality, right?
How would a query to find the real backing device look like in a scenario like this that requires moving the layer twice, or maybe even more in other scenarios?
We have this use case where we need to see what device is backing a device mapper.
Example:
Together with the already existing metric
node_disk_device_mapper_info, it's now possible to map the backing devices to volume groups.