Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KafkaProducer Metrics missing TOPIC name tag #2746

Closed
vijaycse opened this issue Aug 13, 2021 · 5 comments
Closed

KafkaProducer Metrics missing TOPIC name tag #2746

vijaycse opened this issue Aug 13, 2021 · 5 comments
Assignees
Labels
for: external-project For an external project and not something we can fix question A user question, probably better suited for StackOverflow

Comments

@vijaycse
Copy link

vijaycse commented Aug 13, 2021

Issue Description
KakfaConsumerMetrics (MBean implementation) has a way to get the TOPIC name added part of the tags.

but I understand from this issue #1095 that we are not going with MBean implementation anymore.

We have a producer that produces into multiple topics but there is no way for us to differentiate the metrics by TOPICs(unlike consumer)

As you can see the topic name is emitted by the MBean from kakfa
https://docs.confluent.io/platform/current/kafka/monitoring.html#per-topic-metrics

MBean: kafka.producer:type=producer-topic-metrics,client-id=([-.w]+),topic=([-.w]+)

It seems to me that MetricReporter(https://github.com/micrometer-metrics/micrometer/pull/1173/files) implementation not getting everything like MBean.

Rationale
I thing it would be better to add TOPIC name (either by MetricReporter implementation or MBean (not ideal though)
here

private List<Tag> meterTags(Metric metric, boolean includeCommonTags) {

@vijaycse vijaycse added the enhancement A general enhancement label Aug 13, 2021
@jonatan-ivanov jonatan-ivanov self-assigned this Sep 8, 2021
@jonatan-ivanov
Copy link
Member

@vijaycse What metrics do you want to differentiate with the topic name? Kafka only adds the topic name to these metrics:

{name='kafka.producer.topic.record.error.rate', tags=[tag(client.id=producer-1),tag(kafka.version=2.6.0),tag(topic=test)]}
{name='kafka.producer.topic.byte.total', tags=[tag(client.id=producer-1),tag(kafka.version=2.6.0),tag(topic=test)]}
{name='kafka.producer.topic.record.retry.rate', tags=[tag(client.id=producer-1),tag(kafka.version=2.6.0),tag(topic=test)]}
{name='kafka.producer.topic.byte.rate', tags=[tag(client.id=producer-1),tag(kafka.version=2.6.0),tag(topic=test)]}
{name='kafka.producer.topic.record.error.total', tags=[tag(client.id=producer-1),tag(kafka.version=2.6.0),tag(topic=test)]}
{name='kafka.producer.topic.record.send.rate', tags=[tag(client.id=producer-1),tag(kafka.version=2.6.0),tag(topic=test)]}
{name='kafka.producer.topic.record.send.total', tags=[tag(client.id=producer-1),tag(kafka.version=2.6.0),tag(topic=test)]}
{name='kafka.producer.topic.record.retry.total', tags=[tag(client.id=producer-1),tag(kafka.version=2.6.0),tag(topic=test)]}
{name='kafka.producer.topic.compression.rate', tags=[tag(client.id=producer-1),tag(kafka.version=2.6.0),tag(topic=test)]}

@jonatan-ivanov jonatan-ivanov added the waiting for feedback We need additional information before we can continue label Sep 9, 2021
@jonatan-ivanov
Copy link
Member

@vijaycse I'm closing this since the meters above has the topic tag, if you want more meters to have it, I think that should be changed on Kafka side. Please let us know if I misunderstood something and you want the issue to be reopened.

@jonatan-ivanov jonatan-ivanov added for: external-project For an external project and not something we can fix question A user question, probably better suited for StackOverflow and removed enhancement A general enhancement waiting for feedback We need additional information before we can continue labels Sep 15, 2021
@vijaycse
Copy link
Author

Thanks @jonatan-ivanov . I will get back to you. I am still not seeing the topic tag. perhaps its on our side or version. I need to dive deep. thanks for taking a look

@ash432ash
Copy link

ash432ash commented Aug 7, 2024

@vijaycse Do you find any solution for adding the topic tag to the producer metrics? Like for these metrics
request-latency-avg
request-latency-max
We are not getting data topic wise

@vijaycse
Copy link
Author

vijaycse commented Sep 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix question A user question, probably better suited for StackOverflow
Projects
None yet
Development

No branches or pull requests

3 participants