README

TiDB Dashboard

TiDB Dashboard is a Web UI for monitoring, diagnosing and managing TiDB cluster.

Getting Started

The most easy way to use TiDB Dashboard with an existing TiDB cluster is to use the one embedded into PD: http://127.0.0.1:2379/dashboard. Currently you need PD master branch to use TiDB Dashboard.

Note: The TiDB Dashboard inside PD may be not up to date. To play with latest TiDB Dashboard, build it from source (see next section).

Contributing & Developing

If you're interested in contributing to TiDB Dashboard, checkout our help wanted issues for a list, in which we have also marked the difficulty level. We have prepared many suitable tasks.

For a detailed step-by-step contributing guide, or want to build TiDB Dashboard from source, see CONTRIBUTING.md.

⭐️ TiDB Usability Challenge (March 2 ~ May 30) ⭐️

TiDB Dashboard is also a project of TiDB Usability Challenge (UCP), where you can win prizes by contributing code!

Ask for Help

If you have any questions about development, feel free to join TiDB Dashboard SIG (Special Interest Group):

Architecture

This repository contains both Dashboard HTTP API and Dashboard UI. Dashboard HTTP API is placed in pkg/ directory, written in Golang. Dashboard UI is placed in ui/ directory, powered by React.

TiDB Dashboard can also be integrated into PD, as follows:

For Developers How To ...

Keep session valid after rebooting the server

By default, the session secret key is generated dynamically when the server starts. This results in invalidating your previously acquired session token. For easier development, you can supply a fixed session secret key by setting DASHBOARD_SESSION_SECRET in the environment variable or in .env file like:

DASHBOARD_SESSION_SECRET=aaaaaaaaaabbbbbbbbbbccccccccccdd

The supplied secret key must be 32 bytes, otherwise it will not be effective.

Note: the maximum lifetime of a token is 24 hours by default, so you still need to acquire token every 24 hours.

Supply session token in the Swagger UI
  1. Acquire a token first through /user/login in the Swagger UI.

  2. Click the "Authorize" button in the Swagger UI, set value to Bearer xxxx where xxxx is the token you acquired in step 1.

Release new UI assets

Simply modify ui/.github_release_version. The assets will be released automatically after your change is merged to master.

Expand ▾ Collapse ▴

Directories

Path Synopsis
cmd/tidb-dashboard
docs
pkg/apiserver
pkg/apiserver/clusterinfo
pkg/apiserver/diagnose
pkg/apiserver/foo
pkg/apiserver/info
pkg/apiserver/logsearch
pkg/apiserver/profiling
pkg/apiserver/statement
pkg/apiserver/user
pkg/apiserver/utils
pkg/codec
pkg/config
pkg/dbstore
pkg/http
pkg/keyvisual
pkg/keyvisual/decorator Package decorator contains all implementations of LabelStrategy.
pkg/keyvisual/input Package input defines several different data inputs.
pkg/keyvisual/matrix Package matrix abstracts the source data as Plane, and then pixelates it into a matrix for display on the front end.
pkg/keyvisual/region
pkg/keyvisual/storage Package storage stores the input axes in order, and can get a Plane by time interval.
pkg/pd
pkg/swaggerserver
pkg/tidb
pkg/uiserver
pkg/utils
pkg/utils/clusterinfo