Giter Site home page Giter Site logo

pingcap / tidb-dashboard Goto Github PK

View Code? Open in Web Editor NEW
171.0 17.0 125.0 14.12 MB

A Web UI for monitoring, diagnosing and managing the TiDB cluster.

Home Page: https://docs.pingcap.com/tidb/stable/dashboard-intro

License: Apache License 2.0

JavaScript 3.28% HTML 0.64% CSS 0.03% Makefile 0.13% Go 33.30% Shell 0.31% TypeScript 55.65% Ruby 0.03% Less 1.11% Dockerfile 0.07% Perl 5.45%
tidb ui troubleshooting dashboard

tidb-dashboard's Introduction

TiDB Dashboard

GitHub license

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

Documentation

Question, Suggestion

Feel free to open GitHub issues for questions, support and suggestions.

You may also consider to reach out on the TiDB Internals forum if you encounter any problems about TiDB development.

For Chinese users, you can visit the PingCAP official user forum AskTUG.com to make life easier.

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. You need PD master branch or 4.0+ version 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

Checkout our help wanted issues for a list of recommended tasks, in which we have also marked the difficulty level.

See CONTRIBUTING.md for a detailed step-by-step contributing guide, or steps to build TiDB Dashboard from source.

If you need any help, feel free to reach out on the TiDB Internals forum.

Thank you to all the people who already contributed to TiDB Dashboard!

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:

License

Apache License

Copyright 2020 PingCAP, Inc.

tidb-dashboard's People

Contributors

allcontributors[bot] avatar baurine avatar breezewish avatar charlescheung96 avatar connor1996 avatar crazycs520 avatar deardrops avatar dependabot[bot] avatar ericsyh avatar fullstop000 avatar gauss1314 avatar hi-rustin avatar hundundm avatar husharp avatar leiysky avatar maplefu avatar mornyx avatar niedhui avatar nolouch avatar qxhy123 avatar reafans avatar rleungx avatar sabaping avatar shhdgit avatar strrl avatar tennyzhuang avatar unbyte avatar yinixu9506 avatar zhongzc avatar zzh-wisdom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tidb-dashboard's Issues

Investigate I18N default language issue

It is reported that in some scenarios the default language cannot be correctly recogized, result in displaying translation keys, instead of translation words.

Support Standalone PD Port

In order to allow firewalls blocking PD API without blocking Dashboard API and UI, Dashboard should be supported to run on standalone port when integrated with PD.

Provide topology & status API in Dashboard

The topology API should be able to report the topology of TiKV, PD, TiDB, Grafana(if any) and AlertManager(if any), where status should be attached to TiKV, PD and TiDB.

Support Listing Topology

Support listing the cluster (TiDB, TiKV, PD) topology, including IP, port, status port, store ID (TiKV only), label (TiKV only), deployment path, version.

Elect only one PD to start Dashboard

Now PD natively includes the Dashboard. When PD starts, Dashboard starts. However if there are multiple PD nodes, all PD nodes will start a Dashboard instance, which wastes resource.

We should update PD to elect only one PD node to start Dashboard by default.

Introduce DI

Currently we maintain dependencies manually, which is too verbose. We can use DI to make life simple.

make dev run tidy twice

$ make dev
scripts/lint.sh
+ Check golangci-lint binary
+ Run lints
+ Clean up go mod
SWAGGER=1 make server
make swagger_spec
scripts/generate_swagger_spec.sh
+ Install swagger tools
+ Clean up go mod
+ Generate swagger spec
...

UCP: Add TLS Support

Description

This task is to make TiDB Dashboard support TLS TiDB cluster. When Dashboard is running in standalone mode, TLS certificates of the TiDB cluster can be supplied by passing cli arguments. When Dashboard is running with PD, TLS certificates can be obtained from PD cli configuration.

You can see more descriptions in #174

Score

  • 1680

Note: You can get 2530 in total if #177 is also implemented.

Mentor(s)

  • @breeswish

Contact the mentors: #tidb-challenge-program channel in TiDB Community Slack Workspace

Recommended Skills

  • Security
  • Golang
  • Web programming

Log Export API

Implement the log export API according to the tech design document.

Add Gzip Handler

We store assets in gzip now. We can further serve them as gzip as well.

Can not get RegionsInfo

After starting two PDs and use make run to start the dashboard:

[2020/02/24 14:46:37.781 +08:00] [ERROR] [periodic.go:53] ["can not get RegionsInfo"] [error="json: cannot unmarshal string into Go value of type input.RegionsInfo"] [stack="github.com/pingcap/log.Error\n\t/Users/Ryan/PingCAP/go/pkg/mod/github.com/pingcap/[email protected]/global.go:42\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual/input.(*periodicInput).Background\n\t/Users/Ryan/PingCAP/tidb-dashboard/pkg/keyvisual/input/periodic.go:53\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual.(*Service).Start.func2\n\t/Users/Ryan/PingCAP/tidb-dashboard/pkg/keyvisual/service.go:88"]
[2020/02/24 14:47:37.780 +08:00] [ERROR] [periodic.go:53] ["can not get RegionsInfo"] [error="json: cannot unmarshal string into Go value of type input.RegionsInfo"] [stack="github.com/pingcap/log.Error\n\t/Users/Ryan/PingCAP/go/pkg/mod/github.com/pingcap/[email protected]/global.go:42\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual/input.(*periodicInput).Background\n\t/Users/Ryan/PingCAP/tidb-dashboard/pkg/keyvisual/input/periodic.go:53\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual.(*Service).Start.func2\n\t/Users/Ryan/PingCAP/tidb-dashboard/pkg/keyvisual/service.go:88"]
[2020/02/24 14:48:37.782 +08:00] [ERROR] [periodic.go:53] ["can not get RegionsInfo"] [error="json: cannot unmarshal string into Go value of type input.RegionsInfo"] [stack="github.com/pingcap/log.Error\n\t/Users/Ryan/PingCAP/go/pkg/mod/github.com/pingcap/[email protected]/global.go:42\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual/input.(*periodicInput).Background\n\t/Users/Ryan/PingCAP/tidb-dashboard/pkg/keyvisual/input/periodic.go:53\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual.(*Service).Start.func2\n\t/Users/Ryan/PingCAP/tidb-dashboard/pkg/keyvisual/service.go:88"]
[2020/02/24 14:49:37.786 +08:00] [ERROR] [periodic.go:53] ["can not get RegionsInfo"] [error="json: cannot unmarshal string into Go value of type input.RegionsInfo"] [stack="github.com/pingcap/log.Error\n\t/Users/Ryan/PingCAP/go/pkg/mod/github.com/pingcap/[email protected]/global.go:42\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual/input.(*periodicInput).Background\n\t/Users/Ryan/PingCAP/tidb-dashboard/pkg/keyvisual/input/periodic.go:53\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual.(*Service).Start.func2\n\t/Users/Ryan/PingCAP/tidb-dashboard/pkg/keyvisual/service.go:88"]

Version info
dashboard: master
pd: master (bf4aba5)

Shutdown backend services dynamically

After supporting dynamic enabling / disabling Dashboard in PD as in #21 , we need to ensure that when Dashboard is disabled, all Dashboard backend services are shutdown, for example, SQLite should be closed properly and no more resources are consumed.

Cluster report API

The API should be able to generate a cluster report html, using values filled from TiDB diagnose API.

Support Standalone Authentication

Dashboard should be able to sign in use standalone credentials, which is stored in etcd, so that dashboard can auth users even if there is no TiDB.

UCP: Support super user login without TiDB

Description

Now TiDB Dashboard can only be logged in with existing TiDB node. However for pure TiKV deployments there is no TiDB node, makes user unable to use TiDB Dashboard.

For such scenario, we need to provide alternative login method: supply a super user login username and password. The username and hash of the password is stored in PD etcd so that multiple PD nodes can share the same authenticator.

Even if there is a TiDB node in the cluster, when log in use super user, TiDB related functionalities like Statements should not be available (since they requires a valid TiDB connection).

Score

  • 1680

You will be rewarded with extra 300 points if UI is also implemented.

Mentor(s)

  • @breeswish

Contact the mentors: #tidb-challenge-program channel in TiDB Community Slack Workspace

Recommended Skills

  • Security
  • etcd
  • Go web programming

An error occurred while zooming the page

step:

  • Access dashboard
  • Switch to any page other than Key Visualizar
  • Zoom page

then got "NotSupportedError: Failed to read the 'value' property from 'SVGLength': Could not resolve relative length."

Standalone Dashboard on PD

For easier deployment, we should update PD to support PD binary running Dashboard exclusively, i.e. only Dashboard functionality is provided and no PD functionality.

Discussion: Is it better to use standalone Dashboard binary instead of PD binary to fulfill this functionality?

Etcd log does not follow log format

In standalone mode, etcd log is using its own format like this:

[2020/02/20 22:06:06.122 +08:00] [WARN] [tidb_requests.go:71] ["get key failed"] [key=/tidb/server/info] [error="context deadline exceeded"]
[2020/02/20 22:06:54.254 +08:00] [ERROR] [periodic.go:53] ["can not get RegionsInfo"] [error="Get http://127.0.0.1:2379/pd/api/v1/regions: dial tcp 127.0.0.1:2379: connect: connection refused"] [stack="github.com/pingcap/log.Error\n\t/Users/breezewish/go/pkg/mod/github.com/pingcap/[email protected]/global.go:42\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual/input.(*periodicInput).Background\n\t/Users/breezewish/Work/PingCAP/tidb-dashboard/pkg/keyvisual/input/periodic.go:53\ngithub.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual.(*Service).Start.func2\n\t/Users/breezewish/Work/PingCAP/tidb-dashboard/pkg/keyvisual/service.go:86"]
{"level":"warn","ts":"2020-02-20T22:06:55.248+0800","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-72fa7705-b76a-47a4-a64e-8ff99c606a99/127.0.0.1:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest connection error: connection error: desc = \"transport: Error while dialing dial tcp 127.0.0.1:2379: connect: connection refused\""}

which is annoying.

Integrate KeyVis with DBaaS

The KeyVis component should be integrated with DBaaS. API endpoints, front-end assets and so on need to be changed accordingly.

Implement FlameGraph UI

We need a control page, similar to log search page, which allows user to select components to grab the flamegraph, as well as start collecting the flamegraph.

Statement should display more detail for `commit`

Currently in optimistic transaction, most of the write time cost will be counted over commit. As in statement, we will see that a single commit occupies a lot of time. It is essential to allow users view the detail of this single commit, e.g. how many time each "prev statement" costs.

Tech design for Statement backend

TiDB statements SQL is ready. We need to design what kind of interfaces Dashboard should expose, as well as how these interfaces will invoke the Statement SQL.

Provide remove TiDB topology API

When TiDB node is removed, its topology remains. We need to allow user hide specific TiDB node from the topology. If the TiDB node is still alive, this operation should not be allowed. If the TiDB node is partitioned, the TiDB itself should be able to re-add the topology back when partition ends.

Implement FlameGraph backend

The backend in Dashboard provides an API, accepts an array of targets and sends flame graph requests concurrently to these targets. The targets can be TiDB, TiKV or PD. The result of these requests should be stored in our Sqlite storage and the status (running, done) of each target should be recorded and can be retrieved from another interface.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.