// Package metrics defines health-check-service's Prometheus metrics. // Registered automatically (via promauto) into the default registry on // import; served on /metrics. // // device_health_transitions_total is intentionally the same metric name // device-control-service exposes for its "online" transitions (detected via // MQTT touch) — this service only ever emits direction="offline". Prometheus // aggregates same-named metrics across scrape targets/jobs transparently, so // Grafana's `sum by (direction) (...)` panel keeps working across the split // without a query change. package metrics import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) var HealthTransitionsTotal = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "device_health_transitions_total", Help: "Total number of device online/offline transitions detected.", }, []string{"direction"})