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

Yet another example Kafka client configs #413

Closed

Conversation

LiamClarkeNZ
Copy link

@LiamClarkeNZ LiamClarkeNZ commented Aug 14, 2019

@brian-brazil Two configurations I've deployed in production to capture essential (as recommended by the O'Reilly book's chapter on monitoring producers and consumers. Hopefully I got the metric names correct by Prometheus best practices, it's all quite new to me.

Signed-off-by: Liam Clarke <liam.clarke@adscale.co.nz>
Signed-off-by: Liam Clarke <liam.clarke@adscale.co.nz>
@brian-brazil
Copy link
Contributor

The same comments apply here are in #305, KafkaMetricsReporter would be a better approach.

@LiamClarkeNZ
Copy link
Author

@brian-brazil That's true where it's possible to do so. But a problem child of ours is Logstash, and it doesn't expose the ability to configure a metrics reporter for its consumers. In this instance, using the Java agent is the perfect solution.

@brian-brazil
Copy link
Contributor

In that case I'd be looking to provide a config for logstash, not kafka client.

@LiamClarkeNZ
Copy link
Author

In that case I'd be looking to provide a config for logstash, not kafka client.

It is a config for Logstash - the client config above is being used to export metrics for the Kafka client being used internally by Logstash.

@brian-brazil
Copy link
Contributor

I'm not seeing any logstash mBeans there.

@LiamClarkeNZ
Copy link
Author

I'm not seeing any logstash mBeans there.

Hi Brian, Logstash uses the kafka-client consumers to consume from Kafka and write to (in our case) ES, the Kafka consumers instantiated within Logstash register the metric MBeans I'm interested in to understand how Logstash is interacting with Kafka, so the configuration has to specify those metric mbeans.

@brian-brazil
Copy link
Contributor

But this still isn't a logstash configuration. https://www.elastic.co/guide/en/logstash/current/monitoring-logstash.html#monitoring sounds like what you're looking for.

@LiamClarkeNZ
Copy link
Author

LiamClarkeNZ commented Nov 18, 2019

Thanks @brian-brazil,

Unfortunately, the Logstash monitoring APIs do not expose specific Kafka consumer metrics that are highly relevant for diagnosing issues. Here's an example of the Kafka plugin metrics exposed by Logstash:

{
  "plugins": {
    "inputs": [
      {
        "id": "ssp_gauges",
        "events": {
          "out": 1156886854,
          "queue_push_duration_in_millis": 51341252
        },
        "name": "kafka"
      }
    ]
  }
}

However, for diagnosing problems with the Logstash consumers and how they interact with the Kafka cluster, metrics such as kafka.consumer<type=consumer-coordinator-metrics, client-id=(.+)><>sync-rate which are exposed via JMX, but not exposed by Logstash's monitoring API, are essential.

@brian-brazil
Copy link
Contributor

That sounds like a feature request to Logstash then.

@brzyangg
Copy link

brzyangg commented Jul 29, 2020

Hello, LiamClarkeNZ @LiamClarkeNZ
I use your client configs, do not get metrics
kafka version 2.2.0

@LiamClarkeNZ
Copy link
Author

Kia ora @brzyangg, sorry for the very late reply - I hope you managed to resolve your issues :)

@LiamClarkeNZ
Copy link
Author

@fstab @tomwilkie do you think using JMX exporter to monitor kafka client is worthwhile having as an example? If so, I can revisit it to ensure it works for Kafka 2.8 and 3.0, otherwise I'll close the PR :) It is an older use case now that Micrometer can export Kafka client metrics via Prometheus nicely, but I found value in it monitoring apps I couldn't easily change the code of.

@LiamClarkeNZ LiamClarkeNZ deleted the kafka-client-configs branch October 17, 2022 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants