Prometheus Metrics
emeet-pixyd exposes Prometheus-compatible metrics at /metrics using the OpenTelemetry SDK with the Prometheus exporter.
Accessing Metrics
Section titled “Accessing Metrics”curl http://127.0.0.1:8090/metricsOr add a scrape target to your Prometheus config:
scrape_configs: - job_name: "emeet-pixyd" static_configs: - targets: ["localhost:8090"] metrics_path: /metricsAvailable Metrics
Section titled “Available Metrics”Gauges
Section titled “Gauges”| Metric | Type | Description |
|---|---|---|
emeet_pixyd_camera_state |
Float64Gauge | Current camera state (0=offline, 1=tracking, 2=idle, 3=privacy) |
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) |
Counters
Section titled “Counters”| 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 |
Histograms
Section titled “Histograms”| Metric | Type | Description |
|---|---|---|
emeet_pixyd_stream_duration_seconds |
Float64Histogram | MJPEG stream session duration (unit: seconds) |
Implementation Details
Section titled “Implementation Details”- Metrics use
go.opentelemetry.io/otelSDK withgo.opentelemetry.io/otel/exporters/prometheus prometheus/client_golangis kept only forpromhttp.Handler()- Metric registration is lazy via
sync.Once— noinit()functions - All
record*functions are nil-safe — if OTel exporter init fails, metric recording silently no-ops
Health Endpoint
Section titled “Health Endpoint”A JSON health endpoint is also available:
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.
Where to go next
Section titled “Where to go next”- Waybar Integration — lighter-weight camera status in your bar
- Architecture Overview — where metrics fit in the daemon
- Configuration — enable debug mode for pprof
- Related Tools — Prometheus and Grafana in the ecosystem
- Troubleshooting — diagnose via the health endpoint