-
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
First value of query is empty. #15324
Comments
This seems to be pretty much #8010. |
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. |
As nobody seems to have seen this… probably I whould write an unstale-bot that comments into this bug every week or so? |
Steps to reproduce:
Run queries with a GROUP BY time($interval) in which $interval equals the collection time of a metric.
Expected behavior:
Actual behavior:
Environment info:
Analysis of problem and reproduction:
Consider the following output at [1] below.
My query starts at 1570391480000. The cpu metric is collected every 15 seconds.
(From now on, I will truncate the timestamps down to the last 4 significant digits for readability, so that sentence above would become "My query starts at 1480000.")
Hence the values from 1480000 to 1489000 are empty, the first value was collected at 1490000. This behavior is ok and empty output could be suppressed by fill(none).
The query with the 15s GROUP starts at 1475000 - that is 15 seconds before the first value and 5 seconds before the begin of the requested query. The first value is empty and has a count of 0.
What seems to happen: influxdb extends the time-frame backwards by 15 seconds before the first value to cover the full requested query inverval by a time slice AND return time stamps of recorded data (not of some type of query bucket). But it does not extend the time-frame of the actual query in the same way. And so the data from timestamp 1475000 is lost and not included in the result, although an answer is produced for that 15s time period.
Solution(s):
I see two… or three possible ways to solve this and have no preference for either.
a) skip the first data point --> The first data point returned by the query is 1490000 from the example. There is no earlier timestamp returned by the query.
b) also extend the query time backwards. This would keep starting results from 1475000 , but include the data from 1475000
c) start returning groups from exactly the time requested and go in $interval steps from there. This would start at 1480000 and return the value recorded at 1490000 for 1480000
[1]
The text was updated successfully, but these errors were encountered: