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

Querier: prevent unnecessary calls to ingesters #5984

Merged
merged 16 commits into from
Apr 21, 2022

Conversation

dannykopping
Copy link
Contributor

@dannykopping dannykopping commented Apr 21, 2022

What this PR does / why we need it:
For the labels, label values, and series APIs, we are currently not checking if the given query's time range is within the query_ingesters_within lookback period. This results in unnecessary (and often unsuccessful) queries to ingesters for non-recent data.

Which issue(s) this PR fixes:
N/A

Special notes for your reviewer:
We noticed this while conducting some load tests which queried old data, which resulted in high CPU usage on ingesters; this didn't make sense as ingesters only hold recent data, which is then written to chunks and flushed to object storage. Queriers querying old data should only query the object store, not the ingesters.

Checklist

  • Documentation added
  • Tests updated
  • Is this an important fix or new feature? Add an entry in the CHANGELOG.md.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

pkg/querier/querier.go Outdated Show resolved Hide resolved
pkg/querier/querier_test.go Outdated Show resolved Hide resolved
pkg/querier/querier_test.go Show resolved Hide resolved
@dannykopping dannykopping marked this pull request as ready for review April 21, 2022 09:21
@dannykopping dannykopping requested a review from a team as a code owner April 21, 2022 09:21
Copy link
Contributor

@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.

Nice :) LGTM 👍

@dannykopping dannykopping merged commit 3fa6cc9 into grafana:main Apr 21, 2022
@dannykopping dannykopping deleted the series-maxlookback branch April 21, 2022 11:51
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.

3 participants