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

rate[5m] not showing downsampled data #1115

Closed
arnitolog opened this issue May 4, 2019 · 9 comments
Closed

rate[5m] not showing downsampled data #1115

arnitolog opened this issue May 4, 2019 · 9 comments
Labels

Comments

@arnitolog
Copy link
Contributor

Thanos, Prometheus and Golang version used
Thanos: v0.4.0
Prometheus: 2.9.2
no custom build

What happened
rate/irate functions are not working over the data returned from Thanos store
image

What you expected to happen
all functions work with any data
How to reproduce it (as minimally and precisely as possible):

Full logs to relevant components

Anything else we need to know

@arnitolog
Copy link
Contributor Author

arnitolog commented May 4, 2019

more info:
both functions work as expected in case if only raw data is used in the Thanos query. If I try to switch to Auto downsampling or Max 5m or Max1h the function is calculated for the data from the sidecar only.
image
image

@bwplotka
Copy link
Member

bwplotka commented May 9, 2019

Thanks for the report 👍
Ok I think it's fair to scope this issue to "some function are not working with downsampling" right?

@bwplotka bwplotka changed the title some functions are not working over the data returned from Thanos store store some functions are not working over the downsampled data May 9, 2019
@bwplotka
Copy link
Member

bwplotka commented May 9, 2019

It might be tricky on how downsampled is done. To keep the math precision, we downsampled by reducing resolution and aggregating sumples in 5 different chunks per single raw chunk: https://github.com/improbable-eng/thanos/blob/da70cb0445b29dc614253e62ceb712243ecf718b/pkg/compact/downsample/downsample.go#L193

So those function are expected to work for sure: https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time

Rate/Irate however should work just fine as we keep count properly. However rate will work with at least 2 samples in it (: Since you ask for 5m and you use autodownsampling which is either raw, 5m or 1h resolution I am quite sure you don't have 2 samples within 5m, right?

@bwplotka
Copy link
Member

bwplotka commented May 9, 2019

This being said doing rate(.....[below 1h]) with auto downsampling does not make much sense. Wonder what would be the action item to help users here, other than better docs on it? (: @arnitolog

@arnitolog
Copy link
Contributor Author

ok, make sense. But the same worked with the Thanos 0.3.2 and I'm curious has the calculation algorithm been changed

@bwplotka
Copy link
Member

bwplotka commented May 9, 2019

Nothing has changed AFAIK, so should be no difference, otherwise then blocks being now downsampled for you and previously you were hitting just raw data (:

@bwplotka
Copy link
Member

bwplotka commented May 9, 2019

We are working on adding min resolution #1104 so you can specify to not query raw data (: Useful for debugging

@arnitolog
Copy link
Contributor Author

Thanks a lot.

@bwplotka bwplotka changed the title store some functions are not working over the downsampled data rate[5m] not showing data Nov 1, 2019
@bwplotka bwplotka changed the title rate[5m] not showing data rate[5m] not showing downsampled data Nov 1, 2019
@bwplotka
Copy link
Member

bwplotka commented Nov 1, 2019

Just to sum up the rate[5m] will not work with lower resolutions (5m, 1h) as rate requires at least 2 samples (it is recommended to have at least 3) (:

So either something like rate[1h] or rate[$internval] has to be used in Grafana to have it working.

Also please read https://thanos.io/components/compact.md/#downsampling-resolution-and-retention about what downsampling is designed for. We are looking at ways to improve usage (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants