Icecast exporter for Prometheus
105
A Prometheus exporter for the
Icecast streaming media server. Requires the JSON API
(/status-json.xsl) provided by Icecast 2.4.0 or newer.
A modernized fork of markuslindenberg/icecast_exporter by Markus Lindenberg (Apache License 2.0).
By default the exporter listens on port 9146.
docker pull vladios13/icecast_exporter
docker run --rm -p 9146:9146 vladios13/icecast_exporter \
-icecast.scrape-uri http://192.168.10.1:9804/status-json.xsl
Then check http://localhost:9146/metrics.
Can't read JSON: invalid character ' ' in numeric literal — Icecast can emit invalid JSON like "bitrate": 128 kbps; the
response is now sanitized before parsing.log/slog.source field: array, single object, or absent./healthz endpoint.scratch image.docker build -t icecast_exporter .
Requires Go 1.24+:
go build -o icecast_exporter .
go test ./...
Set your Icecast URL in docker-compose.yml, then:
docker compose up -d
The service is limited to 64 MB of RAM, restarts automatically
(restart: unless-stopped) and has a built-in healthcheck.
docker run -d --rm -p 9146:9146 icecast_exporter \
-icecast.scrape-uri http://192.168.10.1:9804/status-json.xsl
Then check http://localhost:9146/metrics.
Usage of ./icecast_exporter:
-healthcheck
Check a running exporter instance and exit (for use as a container healthcheck).
-icecast.scrape-uri string
URI on which to scrape Icecast. (default "http://localhost:8000/status-json.xsl")
-icecast.timeout duration
Timeout for trying to get stats from Icecast. (default 5s)
-web.listen-address string
Address to listen on for web interface and telemetry. (default ":9146")
-web.telemetry-path string
Path under which to expose metrics. (default "/metrics")
| Path | Description |
|---|---|
/metrics | Prometheus metrics |
/healthz | Liveness check, returns 200 ok |
/ | Landing page with a link to metrics |
scrape_configs:
- job_name: icecast
static_configs:
- targets: ["icecast-exporter:9146"]
| Metric | Type | Labels | Description |
|---|---|---|---|
icecast_up | gauge | — | Was the last scrape of Icecast successful (1/0). |
icecast_exporter_total_scrapes | counter | — | Total Icecast scrapes. |
icecast_exporter_json_parse_failures | counter | — | Number of JSON parse errors. |
icecast_server_start | gauge | — | Timestamp (unix) of server startup. |
icecast_listeners | gauge | listenurl, server_type | Listeners per mount point. |
icecast_stream_start | gauge | listenurl, server_type | Timestamp (unix) when the source connected. |
icecast_listeners_total | gauge | — | Total listeners across all mount points. (new) |
icecast_listener_peak | gauge | listenurl, server_type | Peak listeners per mount point. (new) |
icecast_bitrate | gauge | listenurl, server_type | Source bitrate (kbps). (new) |
icecast_source_count | gauge | — | Number of active sources. (new) |
icecast_server_info | gauge | server_id, host, location | Server information; constant 1. (new) |
Fields not reported by the server are not exported.
Content type
Image
Digest
sha256:d2698b6c0…
Size
4.3 MB
Last updated
3 months ago
docker pull vladios13/icecast_exporter