Add users stats http api to ingester#6178
Merged
danielblando merged 5 commits intocortexproject:masterfrom Sep 3, 2024
Merged
Conversation
Signed-off-by: Daniel Deluiggi <ddeluigg@amazon.com>
alanprot
approved these changes
Aug 29, 2024
yeya24
reviewed
Aug 30, 2024
pkg/ingester/http_admin.go
Outdated
| APIIngestionRate float64 `json:"APIIngestionRate"` | ||
| RuleIngestionRate float64 `json:"RuleIngestionRate"` | ||
| ActiveSeries uint64 `json:"activeSeries"` | ||
| LoadBlocks uint64 `json:"loadBlocks"` |
Contributor
There was a problem hiding this comment.
This is unclear to me. I see it just uses db.Blocks(). Does it include head block as well?
How we gonna use this data to help with scale down. Do we check LoadBlocks==0?
Member
There was a problem hiding this comment.
This should be "loadedBlocks" ?
Contributor
Author
There was a problem hiding this comment.
Correct, these are blocks loaded from disk. Head is not really a block yet. The check is more LoadBlocks == 0 && ActiveSeries == 0. I did a revision adding a +1 to loaded blocks to count for the head, but it seems more a hack than what it should be.
I will change the naming for LoadedBlocks, but i would leave it without the head
Signed-off-by: Daniel Deluiggi <ddeluigg@amazon.com>
Contributor
Author
Signed-off-by: Daniel Blando <daniel@blando.com.br>
Signed-off-by: Daniel Deluiggi <ddeluigg@amazon.com>
danielblando
added a commit
to danielblando/cortex
that referenced
this pull request
Sep 3, 2024
* Add users stats http api to ingester Signed-off-by: Daniel Deluiggi <ddeluigg@amazon.com> * Changelog Signed-off-by: Daniel Deluiggi <ddeluigg@amazon.com> * Change name for loadedBlocks Signed-off-by: Daniel Deluiggi <ddeluigg@amazon.com> --------- Signed-off-by: Daniel Deluiggi <ddeluigg@amazon.com> Signed-off-by: Daniel Blando <daniel@blando.com.br>
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:
As mentioned in the feature, it would be nice if we know ingesters are empty to safely scale it down.
This extends the existent api on distributors
/distributors/all_user_statsto also ingesters/ingester/all_user_stats.It was also added to the api the info about
Loaded blockswhich can be used to scale down ingesters.Example of the API on ingester

Which issue(s) this PR fixes:
Fixes #6144
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]