Repository navigation
metrics: add keyspace ID label to changefeed metrics - #5662
Conversation
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (30)
📝 WalkthroughWalkthroughThe change propagates numeric keyspace IDs through sink constructors and statistics, adds ChangesKeyspace-aware metrics
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Code Review
This pull request adds the keyspace_id label to three TiCDC metrics: ticdc_owner_status, ticdc_owner_checkpoint_ts_lag, and ticdc_sink_batch_row_count. To propagate the keyspace ID to the sink metrics, the keyspaceID parameter is now explicitly passed down the sink constructor chain to metrics.NewStatistics. The review feedback recommends exporting the unexported formatKeyspaceID helper function as FormatKeyspaceID from the metrics package and reusing it across the coordinator and statistics modules, which eliminates duplicate string formatting logic and allows removing several unnecessary strconv imports.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Signed-off-by: dongmen <414110582@qq.com>
e3ed6cf to
e54f90b
Compare
Signed-off-by: dongmen <414110582@qq.com>
|
/test all |
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hongyunyan, lidezhu 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:
|
|
/cherry-pick release-nextgen-202603 |
|
@asddongmen: new pull request created to branch DetailsIn response to this:
Instructions 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. |
|
/cherry-pick release-8.5 |
|
@3AceShowHand: new pull request created to branch DetailsIn response to this:
Instructions 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. |
close pingcap#5661 (cherry picked from commit 5d55dc6)
What problem does this PR solve?
Issue Number: close #5661
Changefeed-level owner and sink metrics expose keyspace names but not the numeric keyspace ID, which makes correlation with PD/TiDB keyspace metadata difficult.
What is changed and how it works?
keyspace_idlabel toticdc_owner_checkpoint_ts_lag,ticdc_owner_status, andticdc_sink_batch_row_count_sum.ChangeFeedInfo.KeyspaceID.DispatcherManager.keyspaceIDthrough sink constructors intometrics.Statistics; standalone consumers and redo applier use the default keyspace ID.ChangeFeedID,ChangeFeedDisplayName, protobuf messages, and persisted metadata unchanged.The sink metric is a histogram, so its
_bucket,_sum, and_countseries all receive the label.Check List
Tests
make cdcQuestions
Will it cause performance regression or break compatibility?
No material performance regression is expected. The added label changes Prometheus series identity after upgrade, so dashboards and alerts that aggregate or match exact label sets may need adjustment.
Do you need to update user documentation, design documentation or monitoring documentation?
No repository documentation is changed. The metric compatibility impact is described above.
Release note
Summary by CodeRabbit