Skip to content

Prometheus Metrics

emeet-pixyd exposes Prometheus-compatible metrics at /metrics using the OpenTelemetry SDK with the Prometheus exporter.

Terminal window
curl http://127.0.0.1:8090/metrics

Or add a scrape target to your Prometheus config:

scrape_configs:
- job_name: "emeet-pixyd"
static_configs:
- targets: ["localhost:8090"]
metrics_path: /metrics
Metric Type Description
emeet_pixyd_camera_state Float64Gauge Desired camera state as a per-state label (1=active for state="tracking"/"idle"/"privacy"; intent, never offline)
emeet_pixyd_online Float64Gauge Whether a video device is present (1=online, 0=offline) — connectivity, distinct from camera_state intent
emeet_pixyd_in_call Float64Gauge Whether a call is detected (1=yes, 0=no)
emeet_pixyd_auto_mode Float64Gauge Current auto mode (0=off, 1=full, 2=tracking-only, 3=privacy-only)
emeet_pixyd_breaker_state Float64Gauge HID circuit breaker (1=tripped, 0=closed); trips immediately on the third consecutive commit failure, re-derives from the strike count on every poll tick
Metric Type Description
emeet_pixyd_commands_total Int64Counter Total commands processed
emeet_pixyd_uevents_total Int64Counter Total netlink uevents received
emeet_pixyd_probes_total Int64Counter Total device probes
emeet_pixyd_hid_failures_total Int64Counter Total HID communication failures
emeet_pixyd_frames_total Int64Counter Total MJPEG frames served
emeet_pixyd_auto_errors_total Int64Counter Failed auto-manage operations, by op label (track, audio, source, privacy)
emeet_pixyd_socket_accept_failures_total Int64Counter CLI socket accept failures (10 consecutive mark the daemon degraded)
Metric Type Description
emeet_pixyd_stream_duration_seconds Float64Histogram MJPEG stream session duration (unit: seconds)
  • Metrics use go.opentelemetry.io/otel SDK with go.opentelemetry.io/otel/exporters/prometheus
  • prometheus/client_golang is kept only for promhttp.Handler()
  • Metric registration is lazy via sync.Once — no init() functions
  • All record* functions are nil-safe — if OTel exporter init fails, metric recording silently no-ops

A JSON health endpoint is also available:

Terminal window
curl http://127.0.0.1:8090/api/health
{
"status": "ok",
"camera": "tracking",
"version": "v1.0.0"
}

Returns 503 when the device is offline, 200 when online. That 503 means camera unplugged, not daemon down — picking the wrong endpoint for an alert pages on every unplug. See Monitoring & Health for calibration guidance (Gatus examples included).