debezium/dbz#2380 Export sink connector metrics with correct Prometheus labels - #301
Merged
vjuranek merged 1 commit intoAug 20, 2026
Merged
Conversation
…us labels Sink connectors register their MXBeans as debezium.<plugin>:type=connector-metrics,context=sink,server=<name>,task=<id>, an ordering that none of the existing rules in metrics.yml matches: one expects server before context, and the other has no task and captures server greedily up to '>'. As a result the task key ends up inside the name label, for example name="jdbc-sink, task=0", and no task label is produced. Add a rule for that ordering, before the generic one so that it takes precedence. Sink metrics are then labelled like the source connectors already are, with the connector name in name and the task id in its own label. Signed-off-by: Wagner Santos <wagner.santos@databricks.com>
wagnercsantos
force-pushed
the
dbz-2380-prometheus-sink-labels
branch
from
August 19, 2026 22:03
2de577c to
9ed74a6
Compare
Contributor
Author
|
Hi @Naros — would you have a moment to review this one? It's a small fix (+8/−0 in metrics.yml): the Prometheus JMX exporter config wasn't capturing the context and task labels that the sink connector metrics expose, so those series landed without the labels needed to tell connectors apart. This adds the mapping rules for them. The branch is rebased on current main with linear history, and it's CLEAN follow the same rule at #294. Happy to adjust anything. |
Member
|
Merged, thanks @wagnercsantos ! |
Contributor
Author
|
tks @vjuranek!!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes debezium/dbz#2380.
Sink connectors register their MXBeans as
debezium.<plugin>:type=connector-metrics,context=sink,server=<name>,task=<id>, anordering that none of the existing rules in
metrics.ymlmatches: one expectsserverbefore
context, and the other has notaskand capturesservergreedily up to>.Only the latter matches a sink, so the
taskkey ends up inside thenamelabel and notasklabel is produced.Before:
After:
which is the label shape the source connectors already produce.
The change adds a single rule for the sink ordering, placed before the generic one so
that it takes precedence. Existing rules are untouched, so source connector series are
unaffected.
Verified by running Debezium Server with
JMX_EXPORTER_PORTset and scraping/metricsbefore and after, comparing a sink series against a source series in the same output:
the malformed
nameis corrected, atasklabel appears, and all counter values areunchanged.