A production-ready Prometheus exporter in Go that collects system and application metrics.
- System: CPU, Memory, Disk, Network
- App: HTTP request count, latency (histogram)
- Fully containerized with Docker + Prometheus + Grafana
Real-time monitoring
View Live Grafana Snapshot
prometheus/client_golangintegrationgopsutilfor accurate system metrics- Simulated HTTP traffic for demo
- Multi-stage Docker build (~15MB final image)
- Ready-to-import Grafana dashboard
/healthendpoint- Clean, testable, GitHub-ready code
git clone https://github.com/irvaniamirali/go-prometheus-exporter.git
cd go-prometheus-exporter
docker-compose up -d| Service | URL |
|---|---|
| Exporter | http://localhost:9091/metrics |
| Prometheus | http://localhost:9090 |
| Grafana | http://localhost:3000 (admin/admin) |
Grafana: Import grafana/dashboard.json → + → Import
[Go Exporter] → /metrics → [Prometheus] → [Grafana Dashboard]
- Counter → Request count
- Gauge → System stats
- Histogram → Latency distribution
.
├── main.go
├── metrics/
│ ├── system.go # CPU, RAM, Disk, Network
│ └── app.go # HTTP requests, latency
├── Dockerfile
├── docker-compose.yml
├── prometheus/prometheus.yml
└── grafana/dashboard.json
- Fork the repo
- Create branch:
git checkout -b feat/new-feature - Commit:
git commit -m 'feat: add new feature' - Push & open PR