TiDB exposes runtime metrics via a Prometheus-compatible HTTP endpoint on portDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pingcap/tidb/llms.txt
Use this file to discover all available pages before exploring further.
10080. These metrics can be scraped by Prometheus and visualized in Grafana. TiDB also ships with a built-in dashboard via PD for visual cluster monitoring.
HTTP Status API
The TiDB HTTP Status API is available on port10080 by default. Use it to query live server state and metrics.
| Endpoint | Description |
|---|---|
GET /status | Server status: connections, version, git hash |
GET /metrics | All Prometheus metrics |
GET /regions/meta | Metadata for all regions |
GET /regions/hot | Hot read/write regions by table |
GET /schema | Schema information for all databases |
Key metrics to watch
These metrics are the most useful starting point for diagnosing performance issues and setting up alerts.
| Metric name | Type | What it measures |
|---|---|---|
tidb_server_query_total | Counter | Total queries, labeled by result type |
tidb_server_handle_query_duration_seconds | Histogram | Query latency distribution |
tidb_server_connections | Gauge | Current open client connections |
process_resident_memory_bytes | Gauge | TiDB server memory usage |
tidb_executor_statement_total | Counter | Statements executed, by type |
tidb_tikvclient_txn_cmd_duration_seconds | Histogram | TiKV round-trip latency |
Grafana integration
TiDB ships Grafana dashboard definitions inpkg/metrics/grafana/. A standard TiUP or TiDB Operator deployment provisions Grafana automatically.
Deploy Grafana with TiUP
TiUP includes a Grafana component. It is deployed alongside Prometheus when you run The Grafana URL appears in the output under
tiup cluster deploy.Dashboard.Import dashboards manually
If you are running a custom deployment, import the dashboard JSON files from the TiDB source repository:In Grafana, go to Dashboards > Import and upload the JSON file.
TiDB Dashboard
TiDB Dashboard is built into PD and provides a visual interface for cluster health, slow query analysis, and diagnostics. Access it athttp://<pd-host>:2379/dashboard. Default credentials are the root MySQL user with no password (update this in production).
Key features:
- Cluster overview: topology, node status, alerts
- Slow queries: filterable slow query log with execution plans
- Key Visualizer: heatmap of region read/write traffic
- Diagnostics: automated cluster health report