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
resource_manager/client: introduce RU and Request metrics #6170
resource_manager/client: introduce RU and Request metrics #6170
Conversation
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
requestUnitConfigPath = "resource_group/ru_config" | ||
maxRetry = 3 | ||
maxNotificationChanLen = 200 | ||
requestUnitConfigPath = "resource_group/ru_config" |
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.
need consist with #6063
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.
This will be resolved automatically after merging #6063
resourceGroupTokenRequestCounter.WithLabelValues(name).Inc() | ||
// RU info. | ||
if consumption.RRU != 0 { | ||
rruMetrics.Observe(consumption.RRU) |
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.
Does it's duplicated with the server side?
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.
@JmPotato @BornChanger Do u think it is necessary to count RU consumption of tidb instances?
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.
may do not need in current.
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.
I didn't really think about the need to view RU consumption at the instance level, so not keeping a record is okay for me.
@CabinfeverB: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #6170 +/- ##
==========================================
+ Coverage 74.54% 74.57% +0.03%
==========================================
Files 393 394 +1
Lines 38527 38644 +117
==========================================
+ Hits 28719 28819 +100
- Misses 7268 7285 +17
Partials 2540 2540
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 16 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
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.
lgtm
const ( | ||
namespace = "resource_manager_client" | ||
requestSubsystem = "request" | ||
ruSubsystem = "resource_unit" |
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.
remove this one.
ptal @JmPotato |
Help: "", | ||
}, []string{resourceGroupNameLabel}) | ||
|
||
successfulTokenRequestDuration = prometheus.NewHistogram( |
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.
Maybe add some comments on why "success" is a "Histogram" and "failure" is a "counter".
Help: "", | ||
}, []string{resourceGroupNameLabel}) | ||
|
||
failedRequestCounter = prometheus.NewCounterVec( |
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.
better use label about failed
and success
.
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.
I don't think failed requests need to be recorded, so failedRequestCounter
is Counter.
@@ -192,6 +197,7 @@ func (c *ResourceGroupsController) Start(ctx context.Context) { | |||
for { | |||
select { | |||
case <-c.loopCtx.Done(): | |||
c.resetMetrics() |
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.
Do we need to reset resourceGroupStatusGauge
for each resource group when it's deleted from the client?
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.
Yes, I do it in cleanUpResourceGroup
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
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.
lgtm
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.
rest LGTM!
Subsystem: requestSubsystem, | ||
Name: "success", | ||
Buckets: prometheus.ExponentialBuckets(0.001, 4, 8), // 0.001 ~ 40.96 | ||
Help: "Bucketed histogram of wait duration of successfult request.", |
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.
successful not successfult
@HuSharp: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
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.
The rest LGTM.
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: a62c7cd
|
@CabinfeverB: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
In response to a cherrypick label: new pull request created to branch |
close tikv#6136 Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
close tikv#6136 Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
…tikv#6197) close tikv#6136, ref tikv#6170 Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> Signed-off-by: lhy1024 <admin@liudos.us> Co-authored-by: Yongbo Jiang <cabinfeveroier@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Co-authored-by: lhy1024 <admin@liudos.us> Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
…tikv#6197) close tikv#6136, ref tikv#6170 Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> Signed-off-by: lhy1024 <admin@liudos.us> Co-authored-by: Yongbo Jiang <cabinfeveroier@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Co-authored-by: lhy1024 <admin@liudos.us> Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
What problem does this PR solve?
Issue Number: close #6136
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
Release note