mirror of
https://codeberg.org/icewind/prometheus-mdns-rs.git
synced 2026-06-03 18:04:11 +02:00
mDNS service discovery for prometherus
- Rust 50.4%
- Nix 49.6%
| src | ||
| .dockerignore | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Dockerfile | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| README.md | ||
mDNS service discovery for Prometheus
Discovers mDNS/ZeroConf/Bonjour service announcements under _prometheus-http._tcp for ad-hoc discovery of devices on LAN networks.
Usage
Run the service discovery daemon
prometheus-mdns-sd-rs /etc/prometheus/mdns-sd.json
Configure prometheus to use the output file
- job_name: mdns-sd
scrape_interval: 30s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
file_sd_configs:
- files:
- /etc/prometheus/mdns-sd.json
refresh_interval: 5m
Advertising services
An example of advertising services using the esp8266 arduino sdk
if (!MDNS.begin(hostString)) {
Serial.println("Error setting up MDNS responder!");
}
MDNS.addService("prometheus-http", "tcp", 80);
MDNS.addServiceTxt("prometheus-http", "tcp", "name", prometheus_name);
Credits
Wholly inspired by prometheus-mdns-sd by Morten Siebuhr