-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
queries should be able to access closest point before query time range #5943
Comments
+1. Go back until you have data! |
The difference function is implemented very similar to how derivative is implemented. It is an aggregate function that acts over the entire aggregate. This function will also have the same problems that derivative has with getting values from the previous interval or point. This will be fixed separately as part of #5943. Fixes #1825.
The difference function is implemented very similar to how derivative is implemented. It is an aggregate function that acts over the entire aggregate. This function will also have the same problems that derivative has with getting values from the previous interval or point. This will be fixed separately as part of #5943. Fixes #1825.
The difference function is implemented very similar to how derivative is implemented. It is an aggregate function that acts over the entire aggregate. This function will also have the same problems that derivative has with getting values from the previous interval or point. This will be fixed separately as part of #5943. Fixes #1825.
The difference function is implemented very similar to how derivative is implemented. It is an aggregate function that acts over the entire aggregate. This function will also have the same problems that derivative has with getting values from the previous interval or point. This will be fixed separately as part of #5943. Fixes #1825.
The difference function is implemented very similar to how derivative is implemented. It is an aggregate function that acts over the entire aggregate. This function will also have the same problems that derivative has with getting values from the previous interval or point. This will be fixed separately as part of #5943. Fixes #1825.
For aggregate queries, derivatives will now alter the start time to one interval behind and will use that interval to find the derivative of the first point instead of giving no value for that interval. Null values will still be discarded so if the interval before the one you are querying is null, then it will be discarded like if it were in the middle of the query. You can use `fill(0)` to fill in these values. This does not apply to raw queries yet. Also modified the derivative and difference aggregates to use the stream iterator instead of the reduce slice iterator for space efficiency. Fixes #3247. Contributes to #5943.
For aggregate queries, derivatives will now alter the start time to one interval behind and will use that interval to find the derivative of the first point instead of giving no value for that interval. Null values will still be discarded so if the interval before the one you are querying is null, then it will be discarded like if it were in the middle of the query. You can use `fill(0)` to fill in these values. This does not apply to raw queries yet. Also modified the derivative and difference aggregates to use the stream iterator instead of the reduce slice iterator for space efficiency. Fixes #3247. Contributes to #5943.
For aggregate queries, derivatives will now alter the start time to one interval behind and will use that interval to find the derivative of the first point instead of giving no value for that interval. Null values will still be discarded so if the interval before the one you are querying is null, then it will be discarded like if it were in the middle of the query. You can use `fill(0)` to fill in these values. This does not apply to raw queries yet. Also modified the derivative and difference aggregates to use the stream iterator instead of the reduce slice iterator for space efficiency. Fixes #3247. Contributes to #5943.
For aggregate queries, derivatives will now alter the start time to one interval behind and will use that interval to find the derivative of the first point instead of giving no value for that interval. Null values will still be discarded so if the interval before the one you are querying is null, then it will be discarded like if it were in the middle of the query. You can use `fill(0)` to fill in these values. This does not apply to raw queries yet. Also modified the derivative and difference aggregates to use the stream iterator instead of the reduce slice iterator for space efficiency. Fixes #3247. Contributes to #5943.
For aggregate queries, derivatives will now alter the start time to one interval behind and will use that interval to find the derivative of the first point instead of giving no value for that interval. Null values will still be discarded so if the interval before the one you are querying is null, then it will be discarded like if it were in the middle of the query. You can use `fill(0)` to fill in these values. This does not apply to raw queries yet. Also modified the derivative and difference aggregates to use the stream iterator instead of the reduce slice iterator for space efficiency. Fixes #3247. Contributes to #5943.
This works correctly for aggregate queries, but does not work for raw queries. So if you have data every 10 seconds, you can do this and it will work correctly:
But this won't work with the same data:
|
@jsternberg what would be the behavior with Why does the latter query fail? Provided there are at least two points in the range, shouldn't that return something? |
I've got an interesting edge case for this. So say that we are doing the following query:
The start time of the query is in the middle of an interval. If there are no points in the |
@jsternberg it's not terribly intuitive, but to be consistent with the behavior of If there's data between 12:00 and 12:05, then I think we should use those value(s). The user asked for 10 minute buckets but started them off-center, if you will. That means that they want 10m groupings, but starting at 12:05, so the first and last grouping will have half a bucket's worth of data. If there's data in the other half of the bucket we should use it. It was excluded from the time range, but the If the user wanted to actually use the 11:55-12:05 bucket they would use |
+1 |
I'm also hitting this issue trying to calculate the distance traveled from odometer values: |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is very important and needs to be resolved. Doing multiple queries to get latest value outside the range has also bigger performance impact. Why is bot closing as wontfix? |
Is this duplicate of #6878 ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions. |
Reopen, since still annoying everybody |
here a solution using flux:
|
My approach was slightly different: https://gist.github.com/tillsc/2d71f3e89409049833e75ed22689ad40 |
Forgive my ignorance, but is this type of fix implementable using Grafana? It is crazy that an issue like this has not been fixed in the 5+ years it has been reported. |
There are a number of cases, most importantly
DERIVATIVE()
andFILL(previous)
, where the previous vaule of the field is important. However, there is no way to find that value now.If there are no matching points in the time range,
FILL(previous)
will simply fail, which isn't the expected behavior. It should be able to grab the last recorded value and use that, even if it's from a point before the query time range.The text was updated successfully, but these errors were encountered: