How are buckets in Prometheus's TSDB obtained from TiDB?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: Prometheus的TSDB中的buckets是如何从TIDB获取的

| username: TiDBer_i6YpnMZE

As shown in the picture, I found a bucket monitoring Raft message wait latency while checking Grafana. I couldn’t find the source of the bucket tikv_raftstore_raft_msg_wait_time_duration_secs_bucket through Google, source code, or documentation. Could you please explain how Prometheus obtains this metric? Is there a way to add some monitoring metrics by myself?

| username: Kongdom | Original post link

You can refer to this for adding it yourself.

| username: 小龙虾爱大龙虾 | Original post link

This metric is taken from TiKV, you won’t find it in the TiDB source code :joy_cat:

| username: DBRE | Original post link

You can check the prometheus.yml configuration file for the job_name: “tikv” section, where each TiKV node is configured as targets. Prometheus periodically pulls metric data from these targets and stores it in Prometheus. The corresponding TiKV interface is http://${tikv_ip}:${tikv_status_port}/metrics.

| username: DBRE | Original post link

Reference: 使用 Grafana 监控 TiDB 的最佳实践 | PingCAP 文档中心

| username: TiDBer_i6YpnMZE | Original post link

Thank you for your reply, bro.

| username: TiDBer_i6YpnMZE | Original post link

Thank you for the explanation!

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.