I need to translate InfluxDB query to PromQL, please help. These are the requests: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/diskio
Calculate percent IO utilization per disk and host:
SELECT non_negative_derivative(last("io_time"),1ms) FROM "diskio" WHERE time > now() - 30m GROUP BY "host","name",time(60s)
Calculate average queue depth: iops_in_progress will give you an instantaneous value. This will give you the average between polling intervals.
SELECT non_negative_derivative(last("weighted_io_time"),1ms) from "diskio" WHERE time > now() - 30m GROUP BY "host","name",time(60s)
The following PromQL queries should work assuming this conversion scheme is used for converting InfluxDB data to Prometheus data:
The division by
1000
is needed in order to convert milliseconds to seconds for the corresponding time series -diskio_io_time
anddiskio_weighted_io_time
.Prometheus accepts time range for the query via
start
andend
args passed to /api/v1/query_range Prometheus querying API handler, so queries above have no filters on time.