sum by (node_name) (rate(node_disk_io_time_seconds_total{device=~"(sda|sdb|sdc|sr0)",node_name=~"192-168-137-11"}[20s]) or irate(node_disk_io_time_seconds_total{device=~"(sda|sdb|sdc|sr0)",node_name=~"192-168-137-11"}[5m]) or
(max_over_time(rdsosmetrics_diskIO_util{device=~"(sda|sdb|sdc|sr0)",node_name=~"192-168-137-11"}[20s]) or max_over_time(rdsosmetrics_diskIO_util{device=~"(sda|sdb|sdc|sr0)",node_name=~"192-168-137-11"}[5m]))/100)
so here is my question,
is there any way to get those devices by the node_name from pmm or prometheus api?
thanks in advance.
Not quite sure I understand what you’re after but I think you can do what you need by using the PMM api. Check out the API docs at https:///swagger and you’ll see all the options for getting nodes information and you can filter by type etc. You can then use that data to feed into queries via https:///victoriametrics API. If you know the node_names you are after you can skip the first part. I’m assuming this is to automate all of this so if I’m wrong or missing your goal please let us know and we’ll see if we can get you pointed in the right direction.
I want to get device list like (sda|sdb|sdc|sr0), I know the node_name of the server,
but I don’t know how to get the device list from pmm.
I checked the swagger and /prometheus/metrics, but didn’t find useful api to get those devices
as you can see in the screenshot,
there are dm-x devices as we use LVM to manage the disk,
this is duplicated with sdb and that’s what I want to avoid.
I’m not sure if there are some other duplicated devices not named like dm-x,
so I’d prefer to get device list by pmm API.