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

Merged

Conversation

zjj2wry
Copy link
Contributor

@zjj2wry zjj2wry commented Jan 24, 2021

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

@CLAassistant
Copy link

CLAassistant commented Jan 24, 2021

CLA assistant check
All committers have signed the CLA.

@sre-bot
Copy link
Contributor

sre-bot commented Jan 24, 2021

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what's changed

Or if the count of mainly changed packages are more than 3, use

  • *: what's changed

@sre-bot
Copy link
Contributor

sre-bot commented Jan 24, 2021

@zjj2wry zjj2wry changed the title grafafa dashboards support multi cluster metrics: grafafa dashboards support multiple cluster Jan 24, 2021
@zjj2wry zjj2wry changed the title metrics: grafafa dashboards support multiple cluster metrics: grafana dashboards support multiple cluster Jan 24, 2021
@zjj2wry zjj2wry changed the title metrics: grafana dashboards support multiple cluster metrics: grafana dashboards support multiple clusters Jan 24, 2021
@zjj2wry
Copy link
Contributor Author

zjj2wry commented Jan 24, 2021

/cc @DanielZhangQD

@zjj2wry
Copy link
Contributor Author

zjj2wry commented Jan 24, 2021

/cc @tennix @breeswish @AstroProfundis

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 24, 2021
@jackysp
Copy link
Member

jackysp commented Jan 25, 2021

/run-monitor-test

@sre-bot
Copy link
Contributor

sre-bot commented Jan 25, 2021

Visit the grafana server at: http://172.16.5.5:31657, it will last for 5 hours

@jackysp
Copy link
Member

jackysp commented Jan 25, 2021

/approve

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jan 25, 2021
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Jan 25, 2021
@jackysp
Copy link
Member

jackysp commented Jan 25, 2021

/merge

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

Your auto merge job has been accepted, waiting for:

  • 22482

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@zjj2wry merge failed.

@breezewish breezewish added the sig/diagnosis SIG: Diagnosis label Jan 25, 2021
@breezewish
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 22508

@ti-srebot
Copy link
Contributor

/run-all-tests

@zjj2wry
Copy link
Contributor Author

zjj2wry commented Jan 26, 2021

/label needs-cherry-pick-4.0

@zjj2wry
Copy link
Contributor Author

zjj2wry commented Jan 26, 2021

/run-cherry-picker

@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #22534

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/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants