Skip to content
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

thanos-query-frontend: Enable Thanos Query Stats Propagation & cache response headers #10

Draft
wants to merge 1 commit into
base: monzo-master-v0.35.0-rc-0.65
Choose a base branch
from

Conversation

milesbxf
Copy link

@milesbxf milesbxf commented Nov 15, 2024

Thanos Query gives us some really nice detailed internal stats - but thanos-query-frontend annoyingly blats them by trying to parse the response as a Prometheus response, which has different fields and a different structure.

In addition, thanos-query-frontend doesn't even pass the &stats=all parameter through if you try to request it.

This change fixes this by propagating the stats request parameter to the downstream, and decoding/encoding the Thanos Query stats structure properly.

As an extra, we also set a response header if we get a cache hit so that upstreams can use this.

@milesbxf milesbxf force-pushed the return-stats-response branch 2 times, most recently from a5a0575 to 11d09c7 Compare November 15, 2024 15:47
@milesbxf milesbxf changed the title Return stats response thanos-query-frontend: Enable Thanos Query Stats Propagation & cache response headers Nov 15, 2024
@milesbxf milesbxf force-pushed the return-stats-response branch 6 times, most recently from 6e3b564 to b5c0b42 Compare November 15, 2024 18:14
Thanos Query gives us some really nice detailed internal stats - but thanos-query-frontend annoyingly blats them by trying to parse the response as a Prometheus response, which has different fields and a different structure.

In addition, thanos-query-frontend doesn't even pass the &stats=all parameter through if you try to request it.

This change fixes this by propagating the stats request parameter to the downstream, and decoding/encoding the Thanos Query stats structure properly.

As an extra, we also set a response header if we get a cache hit so that upstreams can use this.

Signed-off-by: milesbryant <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant