JMX Exporter config for MBean attributes

66 views
Skip to first unread message

Martin Schneppenheim

unread,
Dec 9, 2020, 5:29:31 AM12/9/20
to Prometheus Users
I use the JMX exporter to export JMX metrics in the Prometheus format and I managed to make it work for most the JMX metrics. But some JMX metrics are different and therefore I probably need to adapt the JMX exporter config accordingly.

I couldn't manage to export the JMX metrics as shown in JConsole (see screenshot). Among many other configurations I tried this:

```
- pattern: kafka.server<type=socket-server-metrics, listener=(.+), networkProcessor=(.+), name=(connection-count|connection-creation-rate)><>Value
name: "kafka_server_socket_server_metrics"
labels:
listener: $1
network_processor: $2
type: $3
```

This ended up with no metrics for this metric name. How is the exporter config supposed to look like for these MBeans?

Best,
Martin.
Screenshot 2020-12-09 at 11.20.57.png

Knowles Atchison Jr

unread,
Feb 9, 2021, 3:45:14 PM2/9/21
to Prometheus Users
Martin,

I use the follow pattern to pull out socket server metrics:

```
# kafka.server:type=socket-server-metrics,listener={listener_name},networkProcessor={#}
- pattern: kafka.(\w+)<type=(.+), (.+)=(.+), (.+)=(.+)><>([a-z-]+)
  name: kafka_$1_$2_$7
  type: GAUGE
  labels:
    "$3": "$4"
    "$5": "$6"
```

Reply all
Reply to author
Forward
0 new messages