-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make cortex_bucket_store_blocks_loaded metric per user #4918
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -67,7 +67,7 @@ func NewBucketStoreMetrics() *BucketStoreMetrics { | |||
blocksLoaded: prometheus.NewDesc( | ||||
"cortex_bucket_store_blocks_loaded", | ||||
"Number of currently loaded blocks.", | ||||
nil, nil), | ||||
[]string{"user"}, nil), | ||||
seriesDataTouched: prometheus.NewDesc( | ||||
"cortex_bucket_store_series_data_touched", | ||||
"How many items of a data type in a block were touched for a single series request.", | ||||
|
@@ -212,7 +212,7 @@ func (m *BucketStoreMetrics) Collect(out chan<- prometheus.Metric) { | |||
data.SendSumOfCounters(out, m.blockDrops, "thanos_bucket_store_block_drops_total") | ||||
data.SendSumOfCounters(out, m.blockDropFailures, "thanos_bucket_store_block_drop_failures_total") | ||||
|
||||
data.SendSumOfGauges(out, m.blocksLoaded, "thanos_bucket_store_blocks_loaded") | ||||
data.SendSumOfGaugesPerUser(out, m.blocksLoaded, "thanos_bucket_store_blocks_loaded") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this cause an explosion in cardinality if there is a high churn in users? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My 2 cents:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this change is ok, but it looks like store-gateway only "soft deletes" per user metrics:
(the second parameter is "hard delete?" If that's the case, turning a metric to per-user may not be a good idea because of memory leak. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually, I think this PR would prevent memory leak. so, I think we are good to go.
The However, I think this metrics is useful to be per user. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you are talking about benchmarking and continuously tests then every label can be "short lived", right? If we are not reusing the same test user. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea :) |
||||
|
||||
data.SendSumOfSummariesWithLabels(out, m.seriesDataTouched, "thanos_bucket_store_series_data_touched", "data_type") | ||||
data.SendSumOfSummariesWithLabels(out, m.seriesDataFetched, "thanos_bucket_store_series_data_fetched", "data_type") | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should normally avoid this and create a specific PR for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I will remove this change for this pr.