Skip to content

Add caching to QueryRange requests - #3796

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

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

Conversation

@mapno

@mapno mapno commented Jun 20, 2024

Copy link
Copy Markdown
Contributor

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?

@mapno mapno Jun 21, 2024

Copy link
Copy Markdown
Contributor Author

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
mattdurham pushed a commit to mattdurham/tempo that referenced this pull request Jun 18, 2026
* Add caching to QueryRange requests

* fmt

* chlog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants