This Go application monitors Caddy server logs, tracks IPFS CID requests, and exposes Prometheus metrics.
- Real-time log file monitoring
- Tracks unique CIDs and their request counts
- Exposes Prometheus metrics
- Provides a health check endpoint
-
Build the application: go build -o caddy-log-monitor
-
Run the application: ./caddy-log-monitor -log /path/to/caddy/access.log -port 8080 -bind 127.0.0.1 -db /path/to/leveldb
- -log: Path to the Caddy access log file (required)
- -port: Port to listen on (default: 8080)
- -bind: Address to bind to (default: 127.0.0.1)
- -db: Path to LevelDB database (default: in-memory)
- -h, -help: Show help
- /metrics: Prometheus metrics
- /health: Health check
- github.com/fsnotify/fsnotify
- github.com/prometheus/client_golang
- github.com/syndtr/goleveldb
This project is licensed under the Apache License 2.0.