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

split series api queries by day in query-frontend #3530

Merged
merged 2 commits into from
Mar 24, 2021

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:
Series APIs are one of the most expensive queries in Loki which is used by Grafana Explore to suggest relevant labels to the users while building logql query. It is quite easy to run those queries accidentally for longer durations when the selected time window is a week or even a month-long and a user tries to write a query.

The problem here is we split the series API queries the same as other queries and we split the queries by smaller intervals like 15 or 30 minutes to get max parallelism. Now the series API downloads a single chunk per series in each split query which means the smaller the split interval more the work for queries since they would download chunks for the same series over and over again for each split queries. This PR changes the code to split the series API queries by 24h which also aligns with our daily buckets and reaps the same benefits as labels API splitting.

Copy link
Collaborator

@kavirajk kavirajk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

@sandeepsukhani sandeepsukhani merged commit 8694e73 into grafana:master Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants