-
Notifications
You must be signed in to change notification settings - Fork 143
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
[BUG] Timestamps don't appear trimmed when using the VictoriaMetrics backend #648
Comments
Also, querying carbonapi directly, without Grafana, doesn't make any difference. |
So far I don't understand what the problem is. carbonapi trusts backend to return valid data and uses timestamp of a first point as start: If it doesn't match what you are expecting - it means that VictoriaMetrics returned it like that. |
Maybe I don't understand what API carbonapi uses to fetch the data from VM, but the Prometheus API always returns trimmed timestamps for sure, I checked that. If carbonapi relies on the same API (for example, if the "prometheus" protocol is used), then this indicates a bug in the carbonapi logic because it overrides what the backend returns. |
Currently carbonapi uses And as I've showed above - it doesn't override timestamps from the backend reply. |
Ok, I've tried querying VM directly using this API and passing in non-trimmed start and end parameters, and I see that the backend returns timestamps proportional to the values of the boundaries (e.g. if start ends with 5 seconds, and step is 60 seconds, then the first datapoint and all the subsequent ones will also end with 5 seconds), no trimming occurs, as you said. |
With go-carbon it is not exactly trimmed. Data model of whisper actually force timestamps to be aligned to the border of the time bucket (AFAIR on receive it just substracts In case why in grafana you see different results - I guess there is some parameter or header that carbonapi doesn't pass, however for me it's not clear from the VMs documentation what would that be. |
Just as a tiny detail, cch sends the points as is and everything is aligned to timestamps on the CH side during the merging according to retentions config. So the gch have points requested with proper alignment all the time. |
@Felixoid well, gch aligns reply for not yet merged parts. |
Kinda =) In the end, it gets aligned points directly from CH, which matches the original whisper approach. I'd say, CH aligns them. Sorry for offtopic though |
Describe the bug
See VictoriaMetrics/VictoriaMetrics#1555. I did a quick investigation, and both querying and ingestion of metrics work fine on the VM side - the timestamp gets trimmed. However, when querying metrics via Grafana using carbonapi, the metric gets the seconds part of a timestamp set to the current number of seconds (you can see it if you keep changing the time range frequently without hitting the query cache), no matter if I use the prometheus or victoriametrics protocol.
CarbonAPI Version
carbonapi-0.15.4~1-1
CarbonAPI Configuration:
Simplified query (if applicable)
Any metric and query would do.
The text was updated successfully, but these errors were encountered: