sink: Pulsar SDK metrics are not exposed by the TiCDC metrics endpoint
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 56
- Forks
- 63
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 34
Description
What did you do?
Create a Pulsar changefeed and scrape the TiCDC /metrics endpoint.
Code inspection shows that TiCDC creates a dedicated Prometheus registry and exposes that registry through /metrics. The Pulsar SDK receives its registerer from GetMQMetricRegistry. The corresponding initialization function has no call site, so the getter falls back to prometheus.DefaultRegisterer.
What did you expect to see?
Pulsar SDK metrics should be registered in the same Prometheus registry that TiCDC exposes through /metrics, so operators can monitor Pulsar client connections, producers, consumers, and failures.
What did you see instead?
The Pulsar SDK registers its collectors in the default Prometheus registry, while TiCDC gathers from a separately created registry. These are different registry instances, so Pulsar SDK metrics are not included in the TiCDC /metrics output.
The current MQ registry helper also mixes two responsibilities: registering TiCDC-owned MQ metrics and retaining a registry for collectors created later by the Pulsar SDK. This makes duplicate-registration fixes harder and obscures the missing registry wiring.
Acceptance criteria
- Pulsar SDK collectors are registered in the same registry exposed by the TiCDC
/metricsendpoint. - Initializing Pulsar metrics does not duplicate-register MQ worker, Kafka, codec, or claim-check collectors.
- A focused test uses distinct default and server registries and verifies that Pulsar SDK collectors are gatherable from the server registry.
- Concurrent Pulsar changefeed creation does not race while obtaining or using the registry.
Blocked by
None - can start immediately.
Versions of the cluster
Found by code inspection on the current master branch; this is not tied to a specific TiDB or TiKV version.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing GetMQMetricRegistry and the dedicated Prometheus registry exposed at TiCDC's /metrics endpoint. Add a focused test with distinct default and server registries, then verify Pulsar SDK collectors are gathered from the server registry without duplicate registration or races during concurrent changefeed creation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, prometheus
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100