Add Prometheus metrics endpoint and Grafana dashboard#17
Conversation
Agent-Logs-Url: https://github.com/rorpage/gee-bee/sessions/1788ae6d-ed09-4815-ae4f-7316667b0251 Co-authored-by: rorpage <1423093+rorpage@users.noreply.github.com>
|
Closing as no longer compatible with the project direction. The July 3 refactor ("Convert gee-bee to a one-shot binary scheduled by cron/systemd") moved gee-bee to a one-shot binary with no internal loop, and explicitly dropped Docker ("No Docker... Docker adds path, permission, and user complexity that the Go binary approach eliminates entirely" — see AGENTS.md). This PR adds a long-running Generated by Claude Code |
Adds observability to Gee Bee via a Prometheus metrics endpoint and a pre-built, auto-provisioned Grafana dashboard.
Metrics (
internal/metrics/metrics.go)Four counters registered via
promautoand served athttp://0.0.0.0:<port>/metrics:geebee_aircraft_spotted_totaltail_numbergeebee_api_calls_totalgeebee_api_errors_totalgeebee_notifications_sent_totalchanneldiscord,slack,custom_url,terminal)Port defaults to
9090, configurable viaMETRICS_PORTenv var ormetricsPortin config.Grafana Dashboard (
grafana/provisioning/dashboards/gee-bee.json)7-panel dashboard covering rate timeseries for aircraft spotted and notifications by channel, plus stat panels for all four counters. Datasource is templated so it works across Grafana instances.
Docker Compose
docker compose upbrings up all three services — gee-bee (:9090), Prometheus (:9091), and Grafana (:3000) — with the dashboard and datasource auto-provisioned.