Error - Collector already registered that provides name: jmx_scrape_duration_seconds

2,474 views
Skip to first unread message

karan...@gmail.com

unread,
Jul 7, 2017, 3:48:24 PM7/7/17
to Prometheus Users

Hi All,


I'm trying to integrate Prometheus to collect Kafka metrics.

I'm getting error in starting up Kafka, with the JMX exporter passed as java agent. Error is as shown below, any ideas ?


---------------------------------------------------


[root@nwk2-bdp-kafka-06 kafka]# KAFKA_OPTS="$KAFKA_OPTS -javaagent:/usr/hdp/2.5.3.0-37/prometheus/jmx_prometheus_javaagent-0.9.jar=7071:/usr/hdp/2.5.3.0-37/prometheus/jmx_exporter.yaml" ./bin/kafka-server-start.sh config/server.properties 2017-07-07 00:44:31.781:INFO:ipjsoejs.Server:jetty-8.y.z-SNAPSHOT 2017-07-07 00:44:31.866:INFO:ipjsoejs.AbstractConnector:Started SelectChann...@0.0.0.0:7071 Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386) at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401) Caused by: java.lang.IllegalArgumentException: Collector already registered that provides name: jmx_scrape_duration_seconds at io.prometheus.jmx.shaded.io.prometheus.client.CollectorRegistry.register(CollectorRegistry.java:54) at io.prometheus.jmx.shaded.io.prometheus.client.Collector.register(Collector.java:128) at io.prometheus.jmx.shaded.io.prometheus.client.Collector.register(Collector.java:121) at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:38)

Brian Brazil

unread,
Jul 7, 2017, 3:54:35 PM7/7/17
to karan...@gmail.com, Prometheus Users
The only way I can imagine that being possible is if you passed the java agent flag twice.

Brian

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/7e224d46-7354-42be-86d4-2a9a65c58fc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

karan alang

unread,
Jul 7, 2017, 4:10:28 PM7/7/17
to Brian Brazil, Prometheus Users
Hi Brian,

Thanks for the reply, 
however, i don't think i'm passing this twice.

I'm using Kafka 0.10.0.2.5, and using the following command ->

KAFKA_OPTS="$KAFKA_OPTS -javaagent:/usr/hdp/2.5.3.0-37/prometheus/jmx_prometheus_javaagent-0.9.jar=7071:/usr/hdp/2.5.3.0-37/prometheus/jmx_exporter.yaml" ./bin/kafka-server-start.sh config/server.properties

is the jmx jar the correct one for this Kafka version ? 

Also attaching the jmx_exporter.yaml i'm using.


btw, i was actually referring your link -> https://www.robustperception.io/monitoring-kafka-with-prometheus/ to set this up

regds,
Karan Alang

jmx_exporter.yaml
Reply all
Reply to author
Forward
0 new messages