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

metrics: grafana dashboards support multiple clusters (#22503) #22534

Merged
merged 3 commits into from
Jan 27, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Jan 26, 2021

cherry-pick #22503 to release-4.0
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr https://github.com/pingcap/tidb/pull/22534

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/tidb.git pr/22534:release-4.0-8520e763992e

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:
Many users(come from DBaaS、operator、tiup) monitor multiple TiDB clusters in one Grafana, this PR make Grafana dashboards support multiple clusters and not affect single cluster usage. Cluster variable is hidden by default.

What is changed and how it works?

What's Changed:

  1. add a tidb_cluster label in all expr
  2. add cluster variable in Grafana templating

How it Works:
load it to your Grafana :))

Single Cluster:
No change

Multiple Cluster:
Construct a label that can uniquely identify the cluster. in tidb_operator, you can use {namespace}-{cluster_name} as your {tidb_cluster} variable.
add this configuration to your prometheus config

relabel_configs:
  - source_labels:
      - namespace
      - name
    separator: "-"
    target_label: tidb_cluster

Related changes

  • no related changes

Check List

Tests

  • no code

Side effects

  • no effects

Release note

  • metrics: grafana dashboards support multiple clusters

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@zjj2wry please accept the invitation then you can push to the cherry-pick pull requests.
https://github.com/ti-srebot/tidb/invitations

@zjj2wry
Copy link
Contributor

zjj2wry commented Jan 26, 2021

/run-all-tests

Signed-off-by: 郑佳金 <zhengjiajin@pingcap.com>
breezewish
breezewish previously approved these changes Jan 26, 2021
@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 26, 2021
@zjj2wry
Copy link
Contributor

zjj2wry commented Jan 26, 2021

/assign @zhongzc
PTAL

@zhongzc
Copy link
Contributor

zhongzc commented Jan 26, 2021

/lgtm

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jan 26, 2021
@zhongzc
Copy link
Contributor

zhongzc commented Jan 26, 2021

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @zhongzc, this branch cannot be merged without an approval of release maintainers.

@breezewish
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @breeswish, this branch cannot be merged without an approval of release maintainers.

@ti-srebot ti-srebot added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Jan 27, 2021
@bb7133
Copy link
Member

bb7133 commented Jan 27, 2021

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 27, 2021
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@bb7133
Copy link
Member

bb7133 commented Jan 27, 2021

/merge

@ti-srebot ti-srebot merged commit 3e3d3ae into pingcap:release-4.0 Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/metrics sig/diagnosis SIG: Diagnosis status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants