Files
KISS_Prometheus/README.md
2025-10-20 15:44:56 -06:00

37 lines
648 B
Markdown

# Simple Metrics Generator
Simple Prometheus metrics generator.
## Usage
```bash
cat metadata | generate_metrics tempurature 50
```
with your metadata file looking something like
```
unit="F", computer="computer5"
```
---
From here you could then redirect stdout into a file, then host the file with something like Caddy for Prometheus to scrape.
## Examples
A simple "down detector". Put this in a crontab (runs every minute):
```bash
* * * * * cat /etc/metrics_metadata | generate_metrics cloudflare $(ping -c 1 1.1.1.1 &> /dev/null ; echo $?) > /srv/metrics/cloudflare
```
```caddyfile
:80 {
root * /srv/metrics
file_server
}
```