[JMX exporter] At most one of hostPort and jmxUrl must be provided

53 views
Skip to first unread message

Anurag Vaidya

unread,
Jun 29, 2020, 8:59:23 AM6/29/20
to Prometheus Users
Hello everyone,

I am trying to use the JMX exporter to measure Kafka metrics. I have run the command "mvn package" and successfully build the package. I created the config.yaml file:

---
startDelaySeconds: 0
hostPort: 127.0.0.1:8080
username: 
password: 
jmxUrl: service:jmx:rmi:///jndi/rmi://127.0.0.1:8080/jmxrmi
ssl: false
lowercaseOutputName: false
lowercaseOutputLabelNames: false
whitelistObjectNames: ["org.apache.cassandra.metrics:*"]
blacklistObjectNames: ["org.apache.cassandra.metrics:type=ColumnFamily,*"]
rules:
  - pattern: 'org.apache.cassandra.metrics<type=(\w+), name=(\w+)><>Value: (\d+)'
    name: cassandra_$1_$2
    value: $3
    valueFactor: 0.001
    labels: {}
    help: "Cassandra metric $1 $2"
    type: GAUGE
    attrNameSnakeCase: false

However, when I try to see the metrics, I get the following error: At most one of hostPort and jmxUrl must be provided. I tried to remove the jmxUrl, but got the same error. Any advice?

Brian Brazil

unread,
Jun 29, 2020, 9:04:46 AM6/29/20
to Anurag Vaidya, Prometheus Users
That config is for explaining the configuration and should never be used directly. Use the kafka config at https://github.com/prometheus/jmx_exporter/tree/master/example_configs
 

--
Reply all
Reply to author
Forward
0 new messages