Skip to content
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

infoschema: add metrics_tables that contain all metrics tables definition #14721

Merged
merged 8 commits into from
Feb 11, 2020

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Feb 11, 2020

Signed-off-by: crazycs crazycs520@gmail.com

What problem does this PR solve?

  • Add information_schema.metrics_tables that contain all metrics tables definition.
  • Add comment column in all metrics tables to explain the metric meaning.
> select * from `METRICS_TABLES` limit 2\G
***************************[ 1. row ]***************************
METRIC_NAME     | abnormal_stores
PROMQL          | sum(pd_cluster_status{ type=~"store_disconnected_count|store_unhealth_count|store_low_space_count|store_down_count|store_offline_count|store_tombstone_count"})
GENERATE_PROMQL | sum(pd_cluster_status{ type=~"store_disconnected_count|store_unhealth_count|store_low_space_count|store_down_count|store_offline_count|store_tombstone_count"})
LABEL           | instance,type
QUANTILE        | 0.0
COMMENT         |
***************************[ 2. row ]***************************
METRIC_NAME     | connection_count
PROMQL          | tidb_server_connections{$LABEL_CONDITIONS}
GENERATE_PROMQL | tidb_server_connections{}
LABEL           | instance
QUANTILE        | 0.0
COMMENT         | TiDB current connection counts

> select `METRIC_NAME`, `AVG_VALUE`,`COMMENT` from `METRICS_SUMMARY_BY_LABEL` limit 3;
+-------------------------------+-------------------+-----------------------------------------------------------------------+
| METRIC_NAME                   | AVG_VALUE         | COMMENT                                                               |
+-------------------------------+-------------------+-----------------------------------------------------------------------+
| etcd_disk_wal_fsync_rate      | 120.598140046     | The rate of writing WAL into the persistent storage                   |
| etcd_wal_fsync_duration_0.999 |   0.0202235687646 | The quantile time consumed of writing WAL into the persistent storage |
| go_gc_count                   |   0.0799993200264 | The Go garbage collection counts per second                           |
+-------------------------------+-------------------+-----------------------------------------------------------------------+

What is changed and how it works?

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

…tion

Signed-off-by: crazycs <crazycs520@gmail.com>
@crazycs520 crazycs520 added this to the v4.0.0-beta.1 milestone Feb 11, 2020
@@ -1131,14 +1134,25 @@ var tableInspectionResultCols = []columnInfo{
{"DETAILS", mysql.TypeVarchar, 256, 0, nil, nil},
}

var tableMetricTablesCols = []columnInfo{
{"METRIC_NAME", mysql.TypeVarchar, 64, 0, nil, nil},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to name this column as TABLE_NAME.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great,done.

Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

Signed-off-by: crazycs <crazycs520@gmail.com>
Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

Signed-off-by: crazycs <crazycs520@gmail.com>
Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

Co-Authored-By: Lonng <heng@lonng.org>
Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AilinKid AilinKid added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 11, 2020
@crazycs520
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crazycs520
Copy link
Contributor Author

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 11, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Feb 11, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Feb 11, 2020

@crazycs520 merge failed.

@crazycs520
Copy link
Contributor Author

/rebuild

3 similar comments
@crazycs520
Copy link
Contributor Author

/rebuild

@crazycs520
Copy link
Contributor Author

/rebuild

@crazycs520
Copy link
Contributor Author

/rebuild

@crazycs520 crazycs520 added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 11, 2020
@crazycs520
Copy link
Contributor Author

/rebuild

@crazycs520 crazycs520 merged commit 74c6095 into pingcap:master Feb 11, 2020
glorv pushed a commit to glorv/tidb that referenced this pull request Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants