A high-performance JMX metrics exporter for Prometheus, written in Rust. Collects JMX metrics via Jolokia without requiring a JVM.
From Source (Recommended)
git clone https://github.com/jsoonworld/rJMX-Exporter.git
cd rJMX-Exporter
cargo build --release
# Binary at ./target/release/rjmx-exporterDocker
docker pull ghcr.io/jsoonworld/rjmx-exporter:latest
# or build locally
docker build -t rjmx-exporter .Docker Compose (Full Stack Demo)
git clone https://github.com/jsoonworld/rJMX-Exporter.git
cd rJMX-Exporter
docker compose up -d
# Java App: http://localhost:8778/jolokia
# Metrics: http://localhost:9090/metrics
# Prometheus: http://localhost:9091The official jmx_exporter requires a JVM and either shares your app's heap (javaagent) or adds ~50MB overhead (standalone). rJMX-Exporter runs as a native binary sidecar with zero impact on your application.
| Metric | jmx_exporter | rJMX-Exporter |
|---|---|---|
| Memory | ~50MB+ | <10MB |
| Startup | 2-5s | <100ms |
| JVM Required | Yes | No |
| App Impact | Shares GC/Heap | None |
Be aware of these trade-offs:
- Requires Jolokia - Your JVM needs the Jolokia agent for HTTP/JSON access to JMX
- No direct RMI - Cannot connect to JMX via RMI protocol (use Jolokia instead)
- Newer project - Less battle-tested than jmx_exporter in production environments
1. Add Jolokia to your JVM:
java -javaagent:jolokia-jvm-1.7.2.jar=port=8778,host=0.0.0.0 -jar your-app.jar2. Create config.yaml:
jolokia:
url: "http://localhost:8778/jolokia"
server:
port: 9090
rules:
- pattern: 'java.lang<type=Memory><HeapMemoryUsage>(\w+)'
name: "jvm_memory_heap_$1_bytes"
type: gauge3. Run:
./rjmx-exporter -c config.yaml
curl http://localhost:9090/metrics| Document | Description |
|---|---|
| Configuration | Full config reference |
| Migration Guide | Migrate from jmx_exporter |
| CLI Reference | Command-line options |
| Design Doc | Architecture and design decisions |
JVM App (Jolokia) --HTTP/JSON--> rJMX-Exporter --/metrics--> Prometheus
Contributions welcome! Please read CONTRIBUTING.md.
# Development
cargo test # Run tests
cargo clippy # Lint
cargo fmt # Format
# PRs target `develop` branch, not `main`Dual-licensed under MIT or Apache-2.0.
- jmx_exporter - The original Java implementation
- Jolokia - JMX-HTTP bridge
- Tokio & Axum - Async Rust ecosystem