This is a small utility that exports real-time usage statistics from a JetBrains license server as prometheus metrics.
# HELP jls_licenses_allocated Number of JLS Licenses currently allocated
# TYPE jls_licenses_allocated gauge
jls_licenses_allocated{license_name="Rider"} 3
jls_licenses_allocated{license_name="CLion"} 5
# HELP jls_licenses_available Number of JLS Licenses currently available
# TYPE jls_licenses_available gauge
jls_licenses_available{license_name="Rider"} 7
jls_licenses_available{license_name="CLion"} 5
# build the container
docker build --tag jls-exporter .
# run
docker run -d \
--name jls-exporter \
-p 9836:9836
-e JLS_BASE_URL="https://example.com:8080" \
-e JLS_STATS_TOKEN="<supersecrettoken>" \
--stop-timeout 1 \
jls-exporter
Install Rust, set the environment variables and use
cargo run --release
Variable | Default Value | Explanation |
---|---|---|
JLS_BASE_URL | None, always required | Base URL of your license server |
JLS_STATS_TOKEN | None, always required | API token of your license server |
JLS_EXPORTER_BINDADDR | 0.0.0.0:9836 |
Default address this exporter should bind to |