[
https://issues.apache.org/jira/browse/KAFKA-12469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17893547#comment-17893547
]
Joey Pereira commented on KAFKA-12469:
--------------------------------------
Yep, +1 to this. In my particular case, I'm using Kafka MirrorMaker2 (3.6.1)
deployed via strimzi. Our JMX prometheus exporter (again, mostly via strimzi's
{{jmxPrometheusExporter}} metrics config) has a configuration like the
following for JMX -> Prometheus mappings.
{code}
- pattern: kafka.connect.mirror<type=MirrorSourceConnector, target=(.+),
topic=(.+), partition=(.+)><>(byte-count|record-count|...)
name: kafka_connect_mirror_mirrorsourceconnector_$4
labels:
target: "$1"
topic: "$2"
partition: "$3"
help: "Kafka MirrorMaker2 Source Connector metrics"
type: GAUGE
{code}
Then we've got these metrics being collected by a relatively plain Datadog
{{openmetrics}} collection. What I've seen is:
- {{record-count}} will report the true topic name, including {{.}}
- {{bye-count}} will report a munged topic name, with {{.}} transformed to {{_}}
In this case it isn't just producer vs consumer metrics but it appears even the
same metrics source (bean?) appears to have varying results.
> The topic names in the metrics do not retain their format when extracting
> through JMX.
> --------------------------------------------------------------------------------------
>
> Key: KAFKA-12469
> URL: https://issues.apache.org/jira/browse/KAFKA-12469
> Project: Kafka
> Issue Type: Bug
> Components: consumer, metrics
> Reporter: Rafał Chmielewski
> Priority: Major
> Attachments: JConsole - Kafka Client.png
>
>
> I have topic names that have a period in the name:
> product.order
> product.offering.price
>
> However, for the metrics issued by JMX by a program that is a consumer of
> Kafka messages, the dots are replaced with an underscore:
> kafka.consumer<type=consumer-fetch-manager-metrics,
> client-id=consumer-export-4, topic=product_offering_price,
> partition=1><>records-lead
>
> This creates a problem if I want to calculate the customer's lag in relation
> to the number of messages on Kafka.
>
> But for the producer, this problem doesn't occur:
> kafka.producer<type=producer-topic-metrics,
> client-id=bss.data.verification.pi_1,
> topic=product.offering.price><>record-send-total
>
> As a consumer I use Akka Alpakka. But I think it's using Apache library to
> connect to Kafka and report metrics via JMX.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)