Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

grafana dashboards support multiple cluster #556

Merged

Conversation

zjj2wry
Copy link
Contributor

@zjj2wry zjj2wry commented Jan 26, 2021

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

Side effects

  • No effects

Related changes

Release note

  • metrics: grafana dashboards support multiple clusters

@CLAassistant
Copy link

CLAassistant commented Jan 26, 2021

CLA assistant check
All committers have signed the CLA.

@zjj2wry
Copy link
Contributor Author

zjj2wry commented Jan 26, 2021

/cc @tennix @breeswish @AstroProfundis @DanielZhangQD

@zjj2wry
Copy link
Contributor Author

zjj2wry commented Jan 26, 2021

/label needs-cherry-pick-4.0

@ti-srebot
Copy link
Contributor

These labels are not found needs-cherry-pick-4.0.

@kennytm
Copy link
Collaborator

kennytm commented Jan 26, 2021

/lgtm

@ti-srebot ti-srebot added the status/LGT1 One reviewer already commented LGTM (LGTM1) label Jan 26, 2021
@tennix tennix requested a review from overvenus January 26, 2021 10:09
@glorv
Copy link
Contributor

glorv commented Jan 26, 2021

/lgtm

@ti-srebot ti-srebot removed the status/LGT1 One reviewer already commented LGTM (LGTM1) label Jan 26, 2021
@ti-srebot ti-srebot added the status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2) label Jan 26, 2021
@glorv
Copy link
Contributor

glorv commented Jan 26, 2021

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 5b63605 into pingcap:master Jan 26, 2021
@zjj2wry
Copy link
Contributor Author

zjj2wry commented Jan 26, 2021

/cherrypick release-4.0

@zjj2wry zjj2wry added the 4.0-cherry-pick The target branch is release-4.0 label Jan 26, 2021
glorv pushed a commit that referenced this pull request Jan 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.0-cherry-pick The target branch is release-4.0 CanMerge status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants