Add per-tenant TSDB cardinality status API endpoint#7332
Open
CharlieTLe wants to merge 3 commits intocortexproject:masterfrom
Open
Add per-tenant TSDB cardinality status API endpoint#7332CharlieTLe wants to merge 3 commits intocortexproject:masterfrom
CharlieTLe wants to merge 3 commits intocortexproject:masterfrom
Conversation
Expose TSDB head cardinality statistics through a new /api/v1/status/tsdb endpoint, enabling users to identify which metrics, labels, and label-value pairs contribute the most series. This follows the existing UserStats fan-out pattern: ingester calls Head.Stats(), distributor aggregates across the replication set (dividing replicated counts by RF), and an HTTP handler serves JSON with an optional ?limit=N parameter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Charlie Le <charlie_le@apple.com>
Document the new TSDB cardinality status endpoint in the HTTP API reference, including query parameters, example request/response, and field descriptions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Charlie Le <charlie_le@apple.com>
End-to-end test that starts a single-binary Cortex cluster, pushes series with varying cardinality, and validates the TSDB status API returns correct series counts, metric name breakdowns, and limit truncation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Charlie Le <charlie_le@apple.com>
1404aa1 to
2536082
Compare
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.
Summary
/api/v1/status/tsdbendpoint that returns per-tenant TSDB cardinality statistics (series count by metric name, label value counts, memory usage by label, series count by label-value pair, min/max time)Test plan
TSDBStatusgRPC methodTSDBStatusaggregation logicTestTSDBStatus) that starts a single-binary Cortex cluster, pushes series with varying cardinality, and validates correct series counts, metric name breakdowns, label stats, and limit truncation🤖 Generated with Claude Code