Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirement Request: Timeline Tracing #552

Closed
breezewish opened this issue May 28, 2020 · 2 comments
Closed

Requirement Request: Timeline Tracing #552

breezewish opened this issue May 28, 2020 · 2 comments

Comments

@breezewish
Copy link
Member

Description

Related project: TiDB, TiKV, raft-rs, Dashboard

For now it is a bit hard to discover what causes a SQL to run slow in some scenarios. Existing facilities are:

  • “EXPLAIN ANALYZE”: Only useful to know which executor takes a long time, cannot know RocksDB time, raft time, snapshot time, etc. Cannot inspect a SQL in the past.
  • Tracing: Only available in TiDB, cannot trace TiKV, and enabling it will greatly affect the performance so that it is rarely useful to inspect a SQL in the past.
  • Metrics: It displays execution information of all SQLs, when payload is hybrid it is very difficult to figure out. Also metrics are not grouped in a way that we are easy to follow by SQL lifetime.
  • Log / slow log: Different components output their own logs and it is very hard to link them together. Some logs only contain aggregated data and are not precise enough.

Timeline Tracing adds a new tracing layer to both TiDB and TiKV. The existing low-performance tracing facility in TiDB will be dropped. TiKV traces the time of each specific event in the request and packs them along with the response. Timeline tracing is enabled by default and has <1% performance impact.

Timeline tracing displays trace spans like:
image

Timeline tracing can be integrated with a visualization of Execution Plan. The execution plan is usually visualized as:
image

For each executor, users can click and view child spans of the executor. Note that not all spans belong to an executor. Thus an overview of all Timeline tracing spans is still needed.

Category

  • Feature
  • Usability

Value

  • Know where specific SQL performance jitters comes from
  • Explore how much time it takes for each step for each SQL
  • Score: 5

Workload Estimation

60 Person Day

@breezewish
Copy link
Member Author

Related: pingcap/tidb#17693

@breezewish
Copy link
Member Author

This feature is accepted and progress should be tracked in #710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant