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 cluster (#3389) #3398

Merged
merged 1 commit into from
Jan 27, 2021

Conversation

ti-srebot
Copy link
Contributor

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

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

# In pd repo:
git pr https://github.com/tikv/pd/pull/3398

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

git push git@github.com:ti-srebot/pd.git pr/3398:release-4.0-c15cb77a1730

What problem does this PR solve?

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?

  • add a tidb_cluster label in all expr
  • 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

Check List

Tests

  • No code

Code changes

Side effects

  • no effects

Related changes

Release note

  • metrics: grafana dashboards support multiple clusters

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-srebot ti-srebot added first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. status/LGT2 Indicates that a PR has LGTM 2. type/cherry-pick labels Jan 27, 2021
@ti-srebot ti-srebot added this to the v4.0.11 milestone Jan 27, 2021
@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/pd/invitations

@nolouch
Copy link
Contributor

nolouch commented Jan 27, 2021

@zjj2wry, please resolve the conflict.

@codecov
Copy link

codecov bot commented Jan 27, 2021

Codecov Report

Merging #3398 (74cd43b) into release-4.0 (0812e5b) will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-4.0    #3398      +/-   ##
===============================================
- Coverage        74.71%   74.66%   -0.06%     
===============================================
  Files              209      209              
  Lines            19737    19737              
===============================================
- Hits             14747    14736      -11     
- Misses            3650     3665      +15     
+ Partials          1340     1336       -4     
Flag Coverage Δ
unittests 74.66% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/errs/errs.go 75.00% <0.00%> (-25.00%) ⬇️
server/region_syncer/client.go 78.74% <0.00%> (-4.73%) ⬇️
pkg/etcdutil/etcdutil.go 72.05% <0.00%> (-4.42%) ⬇️
server/member/leader.go 63.76% <0.00%> (-2.30%) ⬇️
pkg/btree/btree.go 85.30% <0.00%> (-0.97%) ⬇️
server/grpc_service.go 59.07% <0.00%> (-0.81%) ⬇️
client/client.go 69.54% <0.00%> (-0.51%) ⬇️
server/server.go 73.79% <0.00%> (-0.34%) ⬇️
server/cluster/cluster.go 79.45% <0.00%> (+0.49%) ⬆️
server/core/storage.go 68.80% <0.00%> (+0.91%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0812e5b...74cd43b. Read the comment docs.

@zjj2wry
Copy link
Contributor

zjj2wry commented Jan 27, 2021

/assign

Signed-off-by: zhengjiajin <zhengjiajin@pingcap.com>
@zjj2wry
Copy link
Contributor

zjj2wry commented Jan 27, 2021

@zjj2wry, please resolve the conflict.

done, ptal

@ti-chi-bot
Copy link
Member

@breeswish: /lgtm is only allowed for the reviewers in list.

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.

@zjj2wry
Copy link
Contributor

zjj2wry commented Jan 27, 2021

@HunDunDM @nolouch PTAL

@HunDunDM
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

@HunDunDM: 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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 74cd43b

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

zjj2wry commented Jan 27, 2021

/test idc-jenkins-ci-pd/integration-common-test

@zjj2wry
Copy link
Contributor

zjj2wry commented Jan 27, 2021

/run-all-tests

@HunDunDM
Copy link
Member

/run-integration-common-test

1 similar comment
@zjj2wry
Copy link
Contributor

zjj2wry commented Jan 27, 2021

/run-integration-common-test

@ti-chi-bot ti-chi-bot merged commit 72dc648 into tikv: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
first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants