pingcap / diag

A tool to collect diagnostic data from TiDB Clusters
https://docs.pingcap.com/tidb/stable/clinic-introduction
Apache License 2.0
24 stars 9 forks source link

support dumping metrics by instance #470

Closed zyguan closed 5 months ago

zyguan commented 9 months ago

What problem does this PR solve?

For a large cluster, getSeriesNum may always fail due to quota limit. As a result, significant metrics like tidb_tikvclient_request_seconds and tikv_grpc_msg_duration_seconds are often missing, which blocks troubleshooting.

What is changed and how it works?

With this PR, if getSeriesNum failed, diag will fallback to by-instance dump mode, which get instance list first and call collectMetric by instance.

Check List

Tests

Code changes

Side effects

Related changes

CLAassistant commented 9 months ago

CLA assistant check
All committers have signed the CLA.

codecov-commenter commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (4c0b393) 30.21% compared to head (913f819) 30.21%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #470 +/- ## ======================================= Coverage 30.21% 30.21% ======================================= Files 52 52 Lines 4416 4416 ======================================= Hits 1334 1334 Misses 2911 2911 Partials 171 171 ``` | [Flag](https://app.codecov.io/gh/pingcap/diag/pull/470/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/pingcap/diag/pull/470/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `30.21% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.