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: support multi-k8s in grafana dashboards #4671

Merged
merged 3 commits into from
Feb 24, 2022

Conversation

just1900
Copy link
Contributor

@just1900 just1900 commented Feb 23, 2022

Signed-off-by: just1900 legendj228@gmail.com

What problem does this PR solve?

Issue Number: close #4673

K8s community and organizations are increasingly deploying multiple Kubernetes clusters to improve availability, isolation and scalability. Since TiDB Operator have support deploying tidb across-kubernetes, this PR will address the multi-k8s issue without affecting existing single-cluster use case.

What is changed and how it works?

What's Changed:

  • add a k8s_cluster label in all expr
  • add k8s_cluster variable in Grafana templating

How it works:

  • For users with single-k8s, nothing need to be changed, just use it as before.
  • For users with multi-k8s:
    • first add kubernetes label to identify k8s cluster in your prometheus' external_labels.
    • set field "hide" to '0' to show variables in grafana via sed -i s/"hide": 2/"hide": 0/g <path/to/dashboard.json>
    • load it to grafana

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

metrics: support multi-k8s in grafana dashboards

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 23, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nolouch
  • rleungx

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Feb 23, 2022
Signed-off-by: just1900 <legendj228@gmail.com>
@nolouch
Copy link
Contributor

nolouch commented Feb 23, 2022

Could you add an issue link? and there must reference other components.

@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #4671 (c33512f) into master (6231567) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4671      +/-   ##
==========================================
- Coverage   74.76%   74.74%   -0.02%     
==========================================
  Files         284      284              
  Lines       27816    27816              
==========================================
- Hits        20796    20791       -5     
- Misses       5152     5154       +2     
- Partials     1868     1871       +3     
Flag Coverage Δ
unittests 74.74% <ø> (-0.02%) ⬇️

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%) ⬇️
pkg/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
server/id/id.go 76.19% <0.00%> (-4.77%) ⬇️
server/tso/tso.go 63.06% <0.00%> (-4.55%) ⬇️
pkg/etcdutil/etcdutil.go 82.35% <0.00%> (-3.53%) ⬇️
tools/pd-ctl/pdctl/command/operator.go 66.66% <0.00%> (-1.15%) ⬇️
server/encryptionkm/key_manager.go 72.90% <0.00%> (-0.80%) ⬇️
server/server.go 74.19% <0.00%> (-0.65%) ⬇️
server/handler.go 50.81% <0.00%> (-0.41%) ⬇️
client/client.go 68.89% <0.00%> (+0.10%) ⬆️
... and 6 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 6231567...c33512f. Read the comment docs.

@rleungx
Copy link
Member

rleungx commented Feb 23, 2022

Do we have any test of this PR?

@just1900
Copy link
Contributor Author

just1900 commented Feb 23, 2022

Could you add an issue link? and there must reference other components.

I've added the tidb-operator issue link and PRs for other components into description.

Do we have any test of this PR?

Manual tested by load it to my grafana, it works fine.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 24, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 24, 2022
@nolouch
Copy link
Contributor

nolouch commented Feb 24, 2022

/merge

@ti-chi-bot
Copy link
Member

@nolouch: 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: c33512f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 24, 2022
@ti-chi-bot ti-chi-bot merged commit 4b6f00c into tikv:master Feb 24, 2022
@nolouch nolouch added the needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. label Mar 10, 2022
@nolouch
Copy link
Contributor

nolouch commented Mar 10, 2022

/run-cherry-picker

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4717.

ti-chi-bot added a commit that referenced this pull request Apr 26, 2022
ref #4671, close #4673

Signed-off-by: just1900 <legendj228@gmail.com>

Co-authored-by: just1900 <legendj228@gmail.com>
Co-authored-by: ShuNing <nolouch@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

support multi-k8s in grafana dashboards
4 participants