-
Notifications
You must be signed in to change notification settings - Fork 778
*: delete per-store metrics when a store is tombstoned #11127
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
base: master
Are you sure you want to change the base?
Changes from all commits
5052fa3
2ff912f
a52f905
c7b7180
9cef474
2f87de5
0c7a066
7595061
1f8cc07
9633926
e1e18bb
be431db
2190b39
f294195
8763552
8ceab2c
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 |
|---|---|---|
|
|
@@ -210,6 +210,22 @@ func init() { | |
| prometheus.MustRegister(balanceRangeJobGauge) | ||
| } | ||
|
|
||
| // DeleteStoreMetrics deletes the per-store scheduler metrics of a store. | ||
| func DeleteStoreMetrics(storeID string) { | ||
| opInfluenceStatus.DeletePartialMatch(prometheus.Labels{"store": storeID}) | ||
| balanceWitnessCounter.DeleteLabelValues("move-witness", storeID+"-out") | ||
| balanceWitnessCounter.DeleteLabelValues("move-witness", storeID+"-in") | ||
| hotSchedulerResultCounter.DeletePartialMatch(prometheus.Labels{"store": storeID}) | ||
| balanceDirectionCounter.DeletePartialMatch(prometheus.Labels{"store": storeID}) | ||
| hotDirectionCounter.DeletePartialMatch(prometheus.Labels{"store": storeID}) | ||
| evictedSlowStoreStatusGauge.DeletePartialMatch(prometheus.Labels{"store": storeID}) | ||
| evictedStoppingStoreStatusGauge.DeleteLabelValues(storeID) | ||
| slowStoreTriggerLimitGauge.DeletePartialMatch(prometheus.Labels{"store": storeID}) | ||
| storeSlowTrendEvictedStatusGauge.DeletePartialMatch(prometheus.Labels{"store": storeID}) | ||
|
Member
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.
Contributor
Author
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. Fixed in 2f87de5: DeleteStoreMetrics now also deletes HotPendingSum. |
||
| balanceRangeGauge.DeletePartialMatch(prometheus.Labels{"store": storeID}) | ||
| HotPendingSum.DeletePartialMatch(prometheus.Labels{"store": storeID}) | ||
| } | ||
|
|
||
| func balanceLeaderCounterWithEvent(event string) prometheus.Counter { | ||
| return schedulerCounter.WithLabelValues(types.BalanceLeaderScheduler.String(), event) | ||
| } | ||
|
|
||
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.
Blocking: the MCS RegionBuckets handler has the same incomplete tombstone branch. It logs the condition, then calls HandleRegionBuckets and creates region-buckets metrics with store="". That label cannot be removed by the store-ID cleanup introduced by this PR.
The deterministic MCS regression test I constructed is in pkg/mcs/scheduling/server/grpc_service_test.go (TestRegionBucketsIgnoresTombstoneLeader):
Regression test
The current handler updates the report and creates all three empty-label series, so this test directly covers the regression.