-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
metrics: add different labels for restricted SQL and general SQL #7631
Merged
Conversation
This file contains 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
shenli
added
component/metrics
type/enhancement
The issue or PR belongs to an enhancement.
labels
Sep 6, 2018
zhexuany
reviewed
Sep 6, 2018
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
winkyao
reviewed
Sep 6, 2018
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
I think for end user, |
The newly added label is `sql_type`, it has value: `general` and `internal`, users can use this label to filter metrics they have interest. Also, add keyword `[INTERNAL]` for restricted SQL printed in slow log for convenient identification.
eurekaka
force-pushed
the
restricted_metric_log
branch
from
September 6, 2018 12:12
6e12248
to
2689501
Compare
/run-all-tests |
@coocood updated to |
@coocood PTAL |
LGTM |
coocood
approved these changes
Sep 7, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component/metrics
status/LGT2
Indicates that a PR has LGTM 2.
type/enhancement
The issue or PR belongs to an enhancement.
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.
The newly added label is
sql_type
, it has value:general
andinternal
,users can use this label to filter metrics they have interest.
Also, add keyword
[INTERNAL]
for restricted SQL printed in slow log forconvenient identification.
What problem does this PR solve?
Improve usability of TiDB. We output bunch of metrics for monitoring status of TiDB now, such as time spent on distsql. Sometimes users may notice high distsql time on dashboard, and they may wonder why my simple SQL is spending much time here, but actually, the monitored distsql time may belong to internal SQL queries(called restricted SQL) issued by DDL or auto Analyze for example. To avoid this confusion, we differentiate restricted SQL and general SQL in metrics, users can choose to only reflect metrics of general SQL on dashboard now, or they can monitor restricted SQL status as well.
What is changed and how it works?
add label for:
DistSQLQueryHistgram
QueryDurationHistogram
SessionExecuteParseDuration
SessionExecuteCompileDuration
SessionExecuteRunDuration
Also, add keyword
[INTERNAL]
for restricted SQL printed in slow log for convenient identification.Check List
Tests
Unit test
Manual test (add detailed scripts or steps below)
deploy a TiDB instance with pushgateway, prometheus and grafana for monitor(see also https://github.com/pingcap/tidb-ansible for instructions), run some workload on TiDB instance, then monitor status in grafana using the newly added label
sql_type
for filtering.Related changes
add different labels for restricted SQL and general SQL in metrics