Skip to content

Add caching to QueryRange requests#3796

Merged
mapno merged 3 commits intografana:mainfrom
mapno:metrics-frontend-caching
Jun 21, 2024
Merged

Add caching to QueryRange requests#3796
mapno merged 3 commits intografana:mainfrom
mapno:metrics-frontend-caching

Conversation

@mapno
Copy link
Copy Markdown
Contributor

@mapno mapno commented Jun 20, 2024

What this PR does:

Adds caching to query range requests

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@mapno mapno marked this pull request as ready for review June 20, 2024 16:16

prepareRequestForQueriers(subR, tenantID, subR.URL.Path, subR.URL.Query())
// TODO: Handle sampling rate
key := queryRangeCacheKey(tenantID, queryHash, int64(queryRangeReq.Start), int64(queryRangeReq.End), m, int(queryRangeReq.StartPage), int(queryRangeReq.PagesToSearch))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

seeing a lot of other fields in the QueryRangeRequest struct. Should Step be in the cache key? ShardID/Count?

Copy link
Copy Markdown
Contributor Author

@mapno mapno Jun 21, 2024

Choose a reason for hiding this comment

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

Step is part of the hash. ShardID and ShardCount are used in non-RF1 queries which have a different path.

@mapno mapno merged commit 480e967 into grafana:main Jun 21, 2024
@mapno mapno deleted the metrics-frontend-caching branch June 21, 2024 13:11
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.

3 participants