-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
StoreAPIs be clear about Series() invariants / SeriesSet invariant #1464
Comments
I also think that this is the right solution. |
PromQL yes, however the remote read code on the Prometheus end should be handling this already. It's expected that a series will be spread across frames for constant memory reasons. |
Cool, looks we want to state the same on StoreAPI then. 👍 |
Yes we want to split them in the StoreAPI responses, the only place where everything needs to be available is when PromQL executes, and with the Cortex query optimizations that means at max each split of queries will at most have to have 1 day worth of data in memory. tl;dr yes loosen StoreAPI. |
Cool. This issue (being clear about loosing StoreAPI) is fixed then here where we update StoreAPI proto docs. |
Just want to make sure we are all on the same page on one of the invariants/requirements of StoreAPI.Series API.
Currently, our API assumes that each
Series
frame will hold ALL the chunks for the certain series from a given source. This means that chain of frames like below from single StoreAPI is NOT expected:The same is assumed (implicitly) by
SeriesSet
interfaces e.g here: https://github.com/thanos-io/thanos/blob/master/pkg/store/storepb/custom.go#L80 This invariant is assumed by PromQL engine (@brian-brazil right?) and so far also respected by all our StoreAPI implementations (thanks to https://github.com/thanos-io/thanos/blob/master/pkg/store/storepb/custom.go#L63). However, we never explicitly said that on the API level.What makes it tricky is our recently added remote read streaming DOES allow "continuation of the same series": prometheus/prometheus#5703 Remote read decision to not stick to strict SeriesSet behavior was driven by the goal of having constant memory frames while marshaling/unmarshalling protobuf. Imagine a case when you run a query for 2y against sidecar + Prometheus. With being able to chunk single series into pieces we can guarantee constant memory usage and don't need any sample limit etc. I think that's fair.
Now we have this inconsistency between remote read and StoreAPI (spotted in this PR), where StoreAPI is potentially stricter. Now we have 3 options:
constant memory
reason is quite awesome.Thanks @krasi-georgiev for spotting this.
Thoughts @brancz @brian-brazil @povilasv @GiedriusS @miekg @gouthamve @krasi-georgiev ?
It's worth to note that the recent optimizations for potential caching layer thanks to @tomwilkie are splitting the query on PromAPI level into
days
no matter what. This makes this decision less relevant/important as most likely all chunks will fit into the single frame easily.The text was updated successfully, but these errors were encountered: