Assume you have already deployed PD, TiKV, Prometheus and Grafana.
PD: 127.0.0.1:2379 TiKV: 127.0.0.1:20181, 127.0.0.1:20182, 127.0.0.1:20183 Prometheus: 127.0.0.1:9090 Grafana: 127.0.0.1:3000
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: tikv
static_configs:
- targets: ['127.0.0.1:20181', '127.0.0.1:20182', '127.0.0.1:20183']
- job_name: pd
static_configs:
- targets: ['127.0.0.1:2379']
You can access http://127.0.0.1:9090 and type the "up" command to check all PD and TiKV services are up. See https://gist.github.com/siddontang/873082cefbfa564d628e2cdfe3a7de17#gistcomment-2917505
- Refer to https://grafana.com/docs/features/datasources/prometheus/ to use Prometheus in Grafana.
- Choose a Grafana JSON config file from https://github.com/pingcap/tidb-ansible/tree/master/scripts, like:
wget https://raw.githubusercontent.com/pingcap/tidb-ansible/master/scripts/tikv_details.json
- Import the download file to Grafana (see https://gist.github.com/siddontang/873082cefbfa564d628e2cdfe3a7de17#gistcomment-2917506) and enjoy yourself