Skip to content

storage/tsdb: extract per-tenant TSDBMetrics out of ingesters#14363

Merged
narqo merged 3 commits intomainfrom
vldmr/ingester-tsdb-metrics
Feb 13, 2026
Merged

storage/tsdb: extract per-tenant TSDBMetrics out of ingesters#14363
narqo merged 3 commits intomainfrom
vldmr/ingester-tsdb-metrics

Conversation

@narqo
Copy link
Contributor

@narqo narqo commented Feb 13, 2026

What this PR does

This PR moves the per-tenant TSDBMetrics collector out of the ingester package to allow these metrics to be re-used in the block-builder (I've moved the changes in the blockbuilder package 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.

Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>
Signed-off-by: Vladimir Varankin <vladimir.varankin@grafana.com>
@narqo narqo requested a review from a team as a code owner February 13, 2026 13:23
@narqo narqo added the changelog-not-needed PRs that don't need a CHANGELOG.md entry label 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)),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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>
Copy link
Contributor

@56quarters 56quarters left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for keeping the diff small and splitting this out from the rest of the changes.

@narqo narqo merged commit d613a65 into main Feb 13, 2026
40 checks passed
@narqo narqo deleted the vldmr/ingester-tsdb-metrics branch February 13, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-not-needed PRs that don't need a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments