Skip to content

kafka: fix metrics - #5873

Open
3AceShowHand wants to merge 1 commit into
pingcap:masterfrom
3AceShowHand:kafka-metrics-fix
Open

kafka: fix metrics#5873
3AceShowHand wants to merge 1 commit into
pingcap:masterfrom
3AceShowHand:kafka-metrics-fix

Conversation

@3AceShowHand

@3AceShowHand 3AceShowHand commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #xxx

What is changed and how it works?

Check List

Tests

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

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.

If you don't think this PR needs a release note then fill it with `None`.

Summary by CodeRabbit

  • Refactor
    • Simplified checkpoint delivery processing across cloud storage, Kafka, and Pulsar sinks.
    • Removed checkpoint message count and duration metrics.
    • Removed unused message queue and sink metric definitions while preserving checkpoint delivery behavior.

@ti-chi-bot ti-chi-bot Bot added do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Aug 4, 2026
@ti-chi-bot

ti-chi-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign flowbehappy for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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 ti-chi-bot Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 377f3ef4-2aa2-4af8-86c1-1d0fdc01e740

📥 Commits

Reviewing files that changed from the base of the PR and between c3c98e7 and 918306c.

📒 Files selected for processing (5)
  • downstreamadapter/sink/cloudstorage/sink.go
  • downstreamadapter/sink/kafka/sink.go
  • downstreamadapter/sink/metrics/mq.go
  • downstreamadapter/sink/pulsar/sink.go
  • pkg/metrics/sink.go
💤 Files with no reviewable changes (3)
  • downstreamadapter/sink/pulsar/sink.go
  • downstreamadapter/sink/kafka/sink.go
  • pkg/metrics/sink.go

📝 Walkthrough

Walkthrough

The change removes checkpoint message metrics from cloud storage, Kafka, and Pulsar sinks. It also removes unused MQ metric definitions and registrations while preserving synchronized shared-registry storage and checkpoint delivery behavior.

Changes

Checkpoint metric cleanup

Layer / File(s) Summary
Remove metric definitions and registry wiring
pkg/metrics/sink.go, downstreamadapter/sink/metrics/mq.go
Removed checkpoint metric declarations, registrations, and unused MQ metric definitions. InitMQMetrics retains synchronized registry storage.
Remove checkpoint instrumentation
downstreamadapter/sink/cloudstorage/sink.go, downstreamadapter/sink/kafka/sink.go, downstreamadapter/sink/pulsar/sink.go
Removed checkpoint metric initialization, timing, label cleanup, count updates, and duration observations. Encoding and delivery remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • pingcap/ticdc#5801: Removes overlapping sink checkpoint and MQ metric definitions and registrations.
  • pingcap/ticdc#5818: Changes logging in the Kafka sink file alongside this metric instrumentation cleanup.

Suggested reviewers: wk989898, hongyunyan

Poem

A rabbit found metrics in a checkpoint trail,
And trimmed unused counters from the sail.
Kafka, Pulsar, cloud storage align,
The registry stays locked and fine.
“Hop onward,” said Bun, “the sends still shine!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description retains an unfilled template and omits the problem, implementation details, valid issue reference, test evidence, impact assessment, and release note. Complete each required section, replace the #xxx placeholder with a valid issue reference, and document tests, compatibility impact, documentation needs, and release notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the metrics fix, but it names Kafka although the changes also affect other sinks and shared metrics.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ti-chi-bot

ti-chi-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456.

📖 For more info, you can check the "Contribute Code" section in the development guide.

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

Labels

do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant