JMX to Prometheus exporter: a collector that can configurably scrape and expose mBeans of a JMX target. https://github.com/prometheus/jmx_exporter prometheus/jmx_exporter#111 (comment)
https://hub.docker.com/r/solsson/kafka-prometheus-jmx-exporter
The default JMX exporter in Kafka does not export critical Java Metrics. Kafka frequently runs into heap related failures it is critical to monitor Java Memory Metrics.
This snippet shows how to export Java Memory metrics from any Kafka JXM exporter configuration.
- pattern: 'java.lang<type=Memory><(\w+)MemoryUsage>(\w+): (\d+)'
name: jvm_memory_usage_$2_bytes
labels:
area: "$1" # Heap/NonHeap
value: $3
type: GAUGE
- pattern: 'java.lang<name=([\s\w]+), type=GarbageCollector, key=(\w+)>(.*): (\d+)'
name: jvm_gc_$3
labels:
name: $1
key: $2
value: $4
type: GAUGE
- pattern: 'java.lang<name=([\s\w]+), type=MemoryPool, key=(\w+)>(.*): (\d+)'
name: jvm_mempool_$3
labels:
name: $1
key: $2
value: $4
type: GAUGE
- pattern: 'java.lang<name=([\s\w]+), type=GarbageCollector>(.*): (\d+)'
name: jvm_gc_$2
labels:
name: $1
value: $3
type: GAUGE
- pattern: 'java.lang<name=([\s\w]+), type=MemoryPool>(.*): (\d+)'
name: jvm_mempool_$2
labels:
name: $1
value: $3
type: GAUGE