Client Java supports exporting metrics to Prometheus using poll mode and viewing on Grafana. The following steps shows how to enable this function.
- set the config
tikv.metrics.enable
totrue
- call TiConfiguration.setMetricsEnable(true)
- set the config
tikv.metrics.port
- call TiConfiguration.setMetricsPort
Default port is 3140.
Add the following config to conf/prometheus.yml
and restart Prometheus.
- job_name: "tikv-client"
honor_labels: true
static_configs:
- targets:
- '127.0.0.1:3140'
- '127.0.0.2:3140'
- '127.0.0.3:3140'
Import the Client-Java-Summary dashboard config to Grafana.