-
Notifications
You must be signed in to change notification settings - Fork 106
Support multiple targets that act on different time windows #1739
Conversation
Note: There are a lot of possibilities for datapoint reduction in the "soft" limit case. We can (should?) start with the largest PN Groups (largest defined as most datapoints? Longest time-range?) and then move on to the largest singles. Or maybe the other way around? I think the most important part is being consistent to avoid issues with refreshing causing graph to change (I think this is already consistent, not sure). |
Another thing to consider here is performance for queries that might act on a large number of series. |
In NewPlan, each target has its own context.
This is insufficient. window can be specified as a time but also as a number of points.
Our current context type is incapable of tracking a "from offset" expressed in a number of points, neither is PlanRequests or anything else currently equipped to handle this, and the third case makes this even harder to persue. Perhaps your PR solves some of this, i need to dig more into it, but this looks like a big challenge unless we cut some corners. And then there's a function like timeStack() which seems like it requires multiple from/to pairs. |
Ooh, yeah that could prove quite difficult to support. Perhaps we could "partially" support functions based on the parameters given? Maybe some simple method to abort and proxy during the planning stage (e.g. when |
Yeah that seems like a very good idea. Especially because the most common case would be "simple" queries specifying a time window, not a number of points, which we can handle. |
Hmm, I'm still a little stuck on reconciling:
Graphite will always choose the first retention that satisfies the entire time range. It doesn't have any special behavior for if this is a significant amount of data. This "per-series" behavior is what this PR initially intends to emulate, but doing so in the "soft" req handling results in strange returned results. For example, if we have a query that fetches 100 series with 10k datapoints each (raw) or 1k datapoints (next rollup) and our soft limit is 500k, this PR (at time of this comment) will return the 100 series with 44 of them at raw interval and 56 at the rollup interval. I think intuitively, I would expect them to all be "softened" in step (per target?). |
I'm leaning toward separating In this case, if the same find expression is used in multiple targets, we may still need to fetch them separately if we need to get different archives. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultimately, I decided to leave the "soft" handling the same as it is today and only do the planning differently. I think this takes us one step closer to graphite behavior and supports timeShift
without complicating this PR too much
Any updates? |
I agree that this per-single-granularity will look strange. I don't understand why we need to introduce this granularity. |
As I said above:
|
the stats computation in |
Yes, likely. I'll confess I'm not entirely sure what it's doing right now. It seems like it should be indicating the number of the chosen archive as a meter, but I'm not sure why it would multiply by the number of requests. That would distort the input right? Like how would it differentiate between 100 reqs with archive 1 and 50 reqs with archive 2? |
oops. that's a bug. we should be reporting each archive |
I stand corrected. we only check The PR as a whole makes sense too. |
left todo in this PR:
|
|
To support functions like timeShift and movingWindow, we need to support functions that can adjust the
from
andto
at a per context level. The archive chosen for unrelated requests should not be influenced by time ranges that were adjusted by other functions.