// Package metrics defines device-control-service's Prometheus metrics. // Registered automatically (via promauto) into the default registry on // import; served alongside the command HTTP API's /metrics route. package metrics import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) var ( CommandsTotal = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "device_control_commands_total", Help: "Total number of TurnOn/TurnOff/SetLevel commands dispatched, by action and outcome.", }, []string{"action", "outcome"}) CommandDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "device_control_command_duration_seconds", Help: "Duration of a command dispatch (Redis desired_state patch + MQTT publish), by action.", Buckets: prometheus.DefBuckets, }, []string{"action"}) MQTTEventsTotal = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "device_control_mqtt_events_total", Help: "Total number of telemetry/ack messages received, by event type and outcome.", }, []string{"event_type", "outcome"}) HealthTransitionsTotal = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "device_control_health_transitions_total", Help: "Total number of device online/offline transitions detected.", }, []string{"direction"}) )