diag
is a tool to collect diagnostic data from TiDB clusters. It is mainly designed to be used for TiDB clusters deployed by tiup-cluster
but could also be used for manually deployed ones and TiDB clusters on Kubernetes with limited features.
Use TiUP to install diag
:
tiup install diag
Then use the diag
command to collect data from a TiDB cluster:
tiup diag collect ${cluster-name} -f="-4h" -t="-2h"
Where ${cluster-name}
is the name of TiDB cluster deployed by tiup-cluster
, and the -f/-t
arguments means to collect the diagnostic data from 4 hours ago to 2 hours ago based on the current time.
The data collected from above procedures could be viewed locally for manual investigation or recording usage. There is also an online service that could parse these data and provide more analystic and diagnostic features.
To upload collected data to the PingCAP Clinic, please follow this guide.
Some design and specification docs are in the docs
directory.
- checker: a simple static checker used to parse collected data and list known issues
- collector: a tool to collect system information of a server
- scraper: a tool used to locate log and config files on remote server
- cmd: command line entries for all these tools
- pkg: shared packages
- Install Go version 1.16 or later
- Run
make build
Some extra entries are in Makefile
and could be useful:
make check
:run static code checkmake test
:run all unit testsmake build
:build all binaries
Contributions of code, tests, docs, and bug reports are welcome! To get started, take a look at our open issues.
See also the Contribution Guide in PingCAP's community repo.
This project is licensed onder Apache License Version 2.0.