Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support stddev for matrix with group bys #5385

Open
alburthoffman opened this Issue Mar 20, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@alburthoffman
Copy link

alburthoffman commented Mar 20, 2019

Proposal

Use case. Why is this important?
stddev is quite useful function. and sometimes we want to caculate it for a given time window with group bys. But it turns out that prometheus could support it easily.

Bug Report

What did you do?
simply speaking, I want to do something like this
stddev_over_time(metric[10m]) by (pool, colo)

What did you expect to see?
it will group by metrics with pool and colo, then caculate stddev for last 10m for each group.

What did you see instead? Under which circumstances?
an error which means prometheus doesnot support it.

Environment
lastest prometheus version

any other ideas like avg(metric) by (pool, colo) first, wont get the correct stddev value.
the only solution here for now is to create a new metric which is as same as the old one but only has pool and colo dimensions, and the running stddev_over_time(metric_with_pool_colo_dimensions_only[10m])

so is there a better way to support this? or we can enhance stddev to aggregate matrix?

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 20, 2019

We don't mix cross-sectional and longitudinal aggregations. What you probably want here is a recording rule with the cross-sectional, and then do the over_time on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.