Hi guys,
Is it possible somehow to do something like this?
min_over_time(rate(mysql_global_status_questions{instance="db1"}[2s])[60s])]
Getting - Error executing query: parse error at char 71: range specification must be preceded by a metric selector, but follows a *promql.Call instead
Basically, what I want is to get min rate with per second resolution for the interval of the last 60s (on the graph for each 60s interval).
It allows to spot a problem with metric using lower resolution/interval while still analysing data with higher resolution.
rate() returns value and it can't be used as a range vector for min func.
That's not a problem for gauge metrics but for counters where we have to apply rate() it seems not possible.
Seems a workaround is to create recording rule:
my_new_metric = rate(mysql_global_status_questions[2s])
I will get my “my_new_metric” reflecting the rate.
Then I can easily use min(my_new_metric[$interval]) to graph it.
Any thoughts on this?
Thanks,
Roman
min_over_time(rate(mysql_global_status_questions{instance="db1"}[2s])[60s])]
--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/JOVfqQsVRl8/unsubscribe.
To unsubscribe from this group and all its topics, 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/CALSNGhm%3DQYGq-eS1zLe_tqka3tXswCNBMYxM68dTsXTY%2BJBAZw%40mail.gmail.com.
--
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/CA%2BRUij04sn42kAMz8jcE%2BvqM4wBsn%2BK1Jb9M7OMKnoHF3Px8rw%40mail.gmail.com.
Hi,Well I think any developed language allows for a wrong usage :)
Also I think there might be some special syntax added to indicate such function. This really looks somethat similar from Subqueries in SQL - you can get result of the query to be a table and when you can do another query on it again
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CA%2BRUij3228ZzCq6%3DOzwY_NaA7V0POhVfBYdYZ%2BJvku4fK76MvA%40mail.gmail.com.