--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/99c62289-b399-4f5d-8f95-0fcfe2cc75bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm still picking up PromQL, and mostly have been able to puzzle my way through most target queries, but am stumped on this one currently:This works, and shows me the top 10 devices rebooting the most in an hour:topk(10, changes(device_boot_time[1h]))This shows me the gauge value for all devices matching the "device_info" info-block (aka machine role):device_boot_time * on (instance) group_left(region, firmware) device_info{region="California", firmware="v1.0"}Even through seems to return an instant value - I have not been able to figure out if it is possible to turn into a range vector
Any attempt to put '[5m]' anywhere in this vector matching query results in an error. For example if at the end, the error is:`Error executing query: parse error at char 116: binary expression must contain only scalar and instant vector types`I could put the labels on each metric directly but then lose the series-reducing value of the info-block patternI could probably create a reporting rule, but that means making sure I have a reporting rule for each vector match comboAny solution to this?Thanks,-Preston
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/99c62289-b399-4f5d-8f95-0fcfe2cc75bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 11 September 2018 at 00:13, <presto...@gmail.com> wrote:I'm still picking up PromQL, and mostly have been able to puzzle my way through most target queries, but am stumped on this one currently:This works, and shows me the top 10 devices rebooting the most in an hour:topk(10, changes(device_boot_time[1h]))This shows me the gauge value for all devices matching the "device_info" info-block (aka machine role):device_boot_time * on (instance) group_left(region, firmware) device_info{region="California", firmware="v1.0"}Even through seems to return an instant value - I have not been able to figure out if it is possible to turn into a range vectorWhat you want to do is the range vector operation, and then the group_left:topk(10, changes(device_boot_time[1h]) * on (instance) group_left(region, firmware) device_info{region="California", firmware="v1.0"})Brian
Any attempt to put '[5m]' anywhere in this vector matching query results in an error. For example if at the end, the error is:`Error executing query: parse error at char 116: binary expression must contain only scalar and instant vector types`I could put the labels on each metric directly but then lose the series-reducing value of the info-block patternI could probably create a reporting rule, but that means making sure I have a reporting rule for each vector match comboAny solution to this?Thanks,-Preston
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/99c62289-b399-4f5d-8f95-0fcfe2cc75bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.