metrics: migrate TiFlash Summary dashboard generation to grafanalib (#11027) - #11033
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
@JaySon-Huang This PR has conflicts, I have hold it. |
|
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: JaySon <tshent@qq.com>
|
Cherry-pick conflicts appear resolved; removing the |
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang, yongman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
cb338f8
into
pingcap:release-nextgen-202603
This is an automated cherry-pick of #11027
What problem does this PR solve?
Issue Number: close #11025, close #11028
Problem Summary:
TiFlash Summary Grafana dashboard was maintained as a large hand-edited JSON
blob, which made panel authoring, PromQL consistency, and review hard. This PR
migrates generation to grafanalib (same pattern as TiKV:
common.py+*.dashboard.py), so the dashboard source is Python andtiflash_summary.jsonis a generated artifact. We deliberately prefer Python/
uvover introducing aGo/jsonnet toolchain into TiFlash’s developer workflow and CI.
Design:
docs/design/2026-08-08-grafanalib-dashboard-generation.mdWhat is changed and how it works?
metrics/grafana/common.py: PromQL builders (expr_*),graph_panel/yaxes/Layout, and L3 helpers (ops_panel,duration_panel,cpu_with_limit_panel, heatmap / hit-ratio helpers).tiflash_summary.dashboard.pyas the editable source of truth forTiFlash Summary.
tiflash_summary.json(+.sha256) viagenerate_dashboard.sh(
uv+ grafanalib 0.7.1).metrics/grafana/README.md.docs/design/2026-08-08-grafanalib-dashboard-generation.md.[$__rate_interval]over fixed ranges like[1m]/[30s].right_formaton single-axis panels.yaxis()(Threads IO:Bps→binBps).cpu_with_limit_paneland include$proxy_instance.Check List
Tests
Manual test:
cd metrics/grafana && ./generate_dashboard.shtiflash_summary.json/.sha256are updated and review the diff.Server, Threads CPU, Threads, Coprocessor, Columnar Storage, Raft.
scripts/compare_dashboards.pyfor semanticJSON compare against a legacy baseline. After verification that helper was
removed from tree; it can be restored from git history if needed, e.g.
git show <commit>:metrics/grafana/scripts/compare_dashboards.py.Side effects
Notes: Generated dashboard JSON may differ cosmetically from the previous export
(schema metadata, hidden right-axis defaults, rate interval variable). PromQL /
panel coverage is intended to stay equivalent aside from the intentional
alignments listed above.
tiflash_proxy_summary.json/tiflash_proxy_details.jsonremain hand-maintained.Documentation
Release note
Summary by CodeRabbit
Documentation
New Features