storage/tsdb: extract per-tenant TSDBMetrics out of ingesters#14363
Merged
storage/tsdb: extract per-tenant TSDBMetrics out of ingesters#14363
Conversation
Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>
Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>
narqo
commented
Feb 13, 2026
| MaxBytes: cfg.BlocksStorageConfig.TSDB.HeadPostingsForMatchersCacheMaxBytes, | ||
| Force: cfg.BlocksStorageConfig.TSDB.HeadPostingsForMatchersCacheForce, | ||
| Metrics: metrics.headPostingsForMatchersCacheMetrics, | ||
| Metrics: tsdb.NewPostingsForMatchersCacheMetrics(prometheus.WrapRegistererWithPrefix("cortex_ingester_tsdb_head_", registerer)), |
Contributor
Author
There was a problem hiding this comment.
Note for the reviewers: from what I can tell, the postings-for-matchers metrics aren't per-tenant-TSDB. So the changes in this PR leave the metrics to the ingesters.
The main rational is that the way these specific metics are injected in the tsdb.Open is awkward. Also, the metrics aren't even make sense in the context of the block-builder, who doesn't do any querying.
Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>
56quarters
approved these changes
Feb 13, 2026
Contributor
56quarters
left a comment
There was a problem hiding this comment.
LGTM. Thanks for keeping the diff small and splitting this out from the rest of the changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
This PR moves the per-tenant
TSDBMetricscollector out of theingesterpackage to allow these metrics to be re-used in the block-builder (I've moved the changes in theblockbuilderpackage are to a separate PR, to simplify the review).The changes here are aimed to be pure structural. I don't expect any changes in the existing metrics — currently testing that in a dev environment, and all relevant metrics look fine.