pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.22k stars 493 forks source link

expose server CPU metrics for TiDB and TiPD #208

Closed tkalanick closed 5 years ago

tkalanick commented 5 years ago

only "tikv_thread_cpu_seconds_total" is exposed to grafana. please add cpu metrics for TiDB and TiPD

tennix commented 5 years ago

TiDB and PD don't have CPU metrics by itself. The Overview dashboard gets these metrics from node-exporter. But node-exporter is not managed by tidb-operator. Usually only one node-exporter daemonset will be deployed in a Kubernetes and this is usually deployed globally by kubernetes system administrator.

If you want to see PD/TiDB CPU metrics, you can deploy monitor addons to your kubernetes. And all the pods cpu/memory usage can be viewed on Grafana.

tennix commented 5 years ago

I've just confirmed with TiDB team, they'll expose CPU metrics for TiDB in tidb-server itself.

zz-jason commented 5 years ago

See this issue for more detail: https://github.com/pingcap/tidb/issues/8539

gregwebs commented 5 years ago

TiDB now exposes its own CPU measurement through prometheus. In general I recommend running netdata to look at metrics that are not specific to TiDB.