Skip to content

metricsreader: move cluster-scoped metrics lifecycle into backend clusters (#1105)#1123

Merged
ti-chi-bot[bot] merged 1 commit intopingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-1105-to-release-nextgen-202603
Apr 13, 2026
Merged

metricsreader: move cluster-scoped metrics lifecycle into backend clusters (#1105)#1123
ti-chi-bot[bot] merged 1 commit intopingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-1105-to-release-nextgen-202603

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #1105

What problem does this PR solve?

Issue Number: close #1099

What is changed and how it works:

Move backend metrics lifecycle to the cluster-scoped runtime introduced by the backend-cluster manager.

This PR changes metrics collection so that:

  • each backend cluster owns its own metrics reader
  • backend metrics election is cluster-scoped
  • metrics queries are dispatched through the manager to the right cluster readers

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

…sters

Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.73585% with 59 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-nextgen-202603@8aefd9f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/manager/backendcluster/metrics_querier.go 65.51% 27 Missing and 3 partials ⚠️
pkg/manager/backendcluster/cluster.go 64.51% 10 Missing and 1 partial ⚠️
pkg/balance/metricsreader/query_result.go 80.43% 6 Missing and 3 partials ⚠️
pkg/manager/backendcluster/manager.go 55.55% 4 Missing ⚠️
pkg/balance/metricsreader/metrics_reader.go 82.35% 3 Missing ⚠️
pkg/server/server.go 75.00% 2 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             release-nextgen-202603    #1123   +/-   ##
=========================================================
  Coverage                          ?   67.33%           
=========================================================
  Files                             ?      145           
  Lines                             ?    15263           
  Branches                          ?        0           
=========================================================
  Hits                              ?    10277           
  Misses                            ?     4292           
  Partials                          ?      694           
Flag Coverage Δ
unit 67.33% <77.73%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ti-chi-bot ti-chi-bot bot added the lgtm label Apr 13, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 13, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: YangKeao

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 13, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-13 09:22:04.510715895 +0000 UTC m=+1380129.716075952: ☑️ agreed by YangKeao.

@ti-chi-bot ti-chi-bot bot added the approved label Apr 13, 2026
@ti-chi-bot ti-chi-bot bot merged commit 51e4063 into pingcap:release-nextgen-202603 Apr 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants