-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add sql text counts stats to vtcombo
,vtgate
+vttablet
#15897
Add sql text counts stats to vtcombo
,vtgate
+vttablet
#15897
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Tim Vaillancourt <[email protected]>
52caf00
to
e8ba229
Compare
vtgate
+vttablet
vtcombo
,vtgate
+vttablet
Opened this one with a lot of failing CI to see if others have ideas how to debug The failures are confusing and feel unrelated to this change 🤔 |
Signed-off-by: Harshit Gangal <[email protected]>
There failures are related to the changes made. I have pushed a commit that fixes some of those. You should run the test locally and fix the remaining if any. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15897 +/- ##
==========================================
- Coverage 68.45% 68.22% -0.24%
==========================================
Files 1559 1541 -18
Lines 196825 197330 +505
==========================================
- Hits 134736 134627 -109
- Misses 62089 62703 +614 ☔ View full report in Codecov by Sentry. |
@harshit-gangal indeed it is, thanks! 🤦 🙇
Good point, I've made a bad habit of relying on GitHub Actions CI because many Somehow this was not obvious from the CI outputs I looked at, including this + go-junit-report -set-exit-code
make: *** [Makefile:209: unit_test] Error 1
Error: Process completed with exit code 1. Perhaps it's just the v15 fork/release I'm working on, but I'm used to the |
The first step records the output, if you click on the step below in the CI you will see the output. |
@harshit-gangal ahh, that's where it goes! Thanks a lot |
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.
@shlomi-noach the potential issue of tvaillancourt@REDACTED:~$ curl -s localhost:15000/metrics 2>&1 | grep vttablet_query_sql_text_counts
# HELP vttablet_query_sql_text_counts query sql text counts
# TYPE vttablet_query_sql_text_counts counter
vttablet_query_sql_text_counts{plan="Select",table="Join",workload=""} 3234
vttablet_query_sql_text_counts{plan="Select",table="dual",workload=""} 3650 Let me know if any change is needed. I'll add a |
go/vt/vtgate/vtgate.go
Outdated
@@ -209,6 +209,11 @@ var ( | |||
"VtgateApiRowsAffected", | |||
"Rows affected by a write (DML) operation through the VTgate API", | |||
[]string{"Operation", "Keyspace", "DbType"}) | |||
|
|||
sqlTextCounts = stats.NewCountersWithMultiLabels( | |||
"VtgateSQLTextCounts", |
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, now I understand the intent of this metric, it won't work as implemented. Counters should only be used for monotonically increasing numbers, prometheus will not let you reduce the value of a "counter".
The right type of metric to use here is a Gauge, which can take any value, and change up or down. If I had read the linked issue properly, I would have realized this during the original review.
The name of the metric is also misleading, because it is not a "count" of some specific kind of sql text, it is instead the length in text of the query that is being processed, so the name needs to reflect that.
go/vt/vtgate/vtgate.go
Outdated
@@ -209,6 +209,11 @@ var ( | |||
"VtgateApiRowsAffected", | |||
"Rows affected by a write (DML) operation through the VTgate API", | |||
[]string{"Operation", "Keyspace", "DbType"}) | |||
|
|||
sqlTextCounts = stats.NewCountersWithMultiLabels( | |||
"VtgateSQLTextCounts", |
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.
QueryTextProcessed
will in fact be a better name for the metric.
@shlomi-noach please feel free to dismiss my review if @timvaillancourt is able complete the requested changes before code freeze. |
@deepthi the intent of this metric is a counter that increments forever so we can infer the rate of query text processed at any given time. I don't believe there is a need to ever reduce this metric, it only increases from the time the daemon starts like other counters EDIT: here we can see the counter is only incremented by 0 or more: |
I think the term |
@timvaillancourt to summarize the current state: the changes make sense, and the metric looks correct. But if you could please rename it to something such as |
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
@shlomi-noach / @deepthi I felt Rerequested your review 🙇 |
Some minor wording changes to release notes are required to avoid user confusion. Rest LGTM. @shlomi-noach you may dismiss my review once these changes are done. |
Co-authored-by: Deepthi Sigireddi <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]>
Co-authored-by: Deepthi Sigireddi <[email protected]> Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]>
* `vtgate`: support filtering tablets by tablet-tags (#15911) Signed-off-by: Tim Vaillancourt <[email protected]> Co-authored-by: Shlomi Noach <[email protected]> * Add support for sampling rate in `streamlog` (#15919) Signed-off-by: Tim Vaillancourt <[email protected]> * Fix merge conflict resolution Signed-off-by: Tim Vaillancourt <[email protected]> * update rand import Signed-off-by: Tim Vaillancourt <[email protected]> * Add sql text counts stats to `vtcombo`,`vtgate`+`vttablet` (#15897) Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]> * missing rename Signed-off-by: Tim Vaillancourt <[email protected]> * missing rename again Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Shlomi Noach <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]>
* `vtgate`: support filtering tablets by tablet-tags (#15911) Signed-off-by: Tim Vaillancourt <[email protected]> Co-authored-by: Shlomi Noach <[email protected]> * Add support for sampling rate in `streamlog` (#15919) Signed-off-by: Tim Vaillancourt <[email protected]> * Add sql text counts stats to `vtcombo`,`vtgate`+`vttablet` (#15897) Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Shlomi Noach <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]>
…et` (#15897) Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]>
…et` (vitessio#15897) (#525) * `slack-15.0`: Add sql text counts stats to `vtcombo`,`vtgate`+`vttablet` (#15897) Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]> * Update help as well Signed-off-by: Tim Vaillancourt <[email protected]> --------- Signed-off-by: Tim Vaillancourt <[email protected]> Signed-off-by: Harshit Gangal <[email protected]> Co-authored-by: Harshit Gangal <[email protected]> Co-authored-by: Deepthi Sigireddi <[email protected]>
Description
This PR adds stats for the size of query text processed by
vtgate
andvttablet
This is useful to understand large queries that potentially cause performance, grpc message size, bandwidth problems
Related Issue(s)
Resolves #15929
Checklist
Deployment Notes