-
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
query: Timings/Stats in API looks different than Prometheus #7960
Comments
Hey @jan-kantert! I'm here to assist you with any bugs, questions, or contributions. Let's tackle this issue together! The discrepancy you're experiencing between Thanos and Prometheus API responses when using Currently, there is no documentation or code comments in the Thanos repository that explain the purpose of the To address this, you might need to adjust your client library to handle the Thanos response format or implement a workaround that maps the Thanos response to the expected Prometheus format. |
I disagree with your judgement. One of the stated goals of Thanos is to offer a Prometheus compatible API. From the webpage:
Same tool breaks because Thanos Query API does not behave like the Prometheus Query API (which seems to violate a stated project goal). |
Are you using the new Thanos engine or the Prometheus query engine? If it is the new engine I understand we don't support the timing stats. |
Just out of curiosity - are stats official API? I didn't find it in the prometheus http API spec. It feels like this depends somewhat on the engine and backend as to what stats make sense to display |
Good question. I am not 100% sure. thanos-query-frontend -> Missing timing field So yeah it looks like your analysis might be correct.
I wondered that as well. Seems like most libraries support them based on whats returned in Prometheus. |
I do think Thanos Query Frontend needs additional work to propagate them. But due to the nature of Thanos as queries are usually sharded, it is probably doesn't make much sense to progagate 100% the same timings info like Prometheus does For example, Thanos can have its own
That's because those libraries just proxy/forward the Prometheus response while Thanos has additional sharding or other logic |
Thanos, Prometheus and Golang version used: 0.37.1
Object Storage Provider: S3
What happened:
When requesting
stats=all
from the API my client library breaks since the output looks different than what Prometheus returns.URL http://thanos/api/v1/query?stats=all&query=sum(nginx_ingress_controller_requests)
What I got:
What you expected to happen:
I expected an output such as (this is from Prometheus):
How to reproduce it (as minimally and precisely as possible):
Open in your browser: http://thanos/api/v1/query?stats=all&query=sum(nginx_ingress_controller_requests)
Then open the same in your browser for Prometheus: http://prometheus/api/v1/query?stats=all&query=sum(nginx_ingress_controller_requests)
Anything else we need to know:
My client library breaks due to the missing
timings
key: puetzp/prometheus-http-query#15The text was updated successfully, but these errors were encountered: