jmx_exporter icon indicating copy to clipboard operation
jmx_exporter copied to clipboard

Is there any mechanism to work with Prometheus SDK

Open cuichenli opened this issue 3 years ago • 3 comments

As stated in the title, is there anyway to achieve this?

Our scenario: We are using Kafka Connect with JMX exporter, however, in our connect task, we would like to expose some extra customized metrics. What I managed to do is implement the MBeans and JMX exporter can successfully collect the data. But this is increasing a lot of complexity in the code base and we are wondering if we can use the Prometheus SDK to export those data instead and still have JMX exporter.

Thanks in advance!

cuichenli avatar Dec 13 '21 05:12 cuichenli

Hi, I'm happy to help, but I need some more information on your usage of jmx_exporter and the connect task. Is your connect task a Java program using jmx_exporter as a "library", or do you use an unmodified version of jmx_exporter and the connect task is an independent tool? Are you using jmx_exporter as a Java agent, or as a standalone process connecting to Kafka over the network? And in which component did you implement you custom MBean?

fstab avatar Dec 13 '21 08:12 fstab

Thanks for your response. We are using jmx_exporter as a java agent without modifying it. Basically what we did is just download the jar file and specify the -javaagent flag. At the moment we implemented the custom MBean in our Kafka connect code base.

cuichenli avatar Dec 14 '21 05:12 cuichenli

@cuichenli What you are doing is the correct approach. I would not recommend trying interface with internal Prometheus classes instances.

dhoard avatar Dec 22 '21 03:12 dhoard

Closing as stale. Please reopen if you would like to continue the discussion.

dhoard avatar Jun 24 '23 01:06 dhoard