mirror of
https://codeberg.org/icewind/prometheus-mdns-rs.git
synced 2026-06-03 18:04:11 +02:00
dockerfile, readme and licence
This commit is contained in:
parent
7916a2fc5f
commit
1647e0baba
5 changed files with 281 additions and 0 deletions
41
README.md
Normal file
41
README.md
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# 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
|
||||
|
||||
```yaml
|
||||
- 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
|
||||
|
||||
```arduino
|
||||
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](https://github.com/msiebuhr/prometheus-mdns-sd) by Morten Siebuhr
|
||||
Loading…
Add table
Add a link
Reference in a new issue