Skip to main content

Health endpoints

Voxray exposes two HTTP endpoints for health checking. They are unauthenticated and designed to be called directly by load balancers and orchestrators. Use /health as the liveness probe and /ready as the readiness probe. Do not swap them: a failing Redis should remove the pod from the load balancer’s rotation (/ready), but it should not cause Kubernetes to restart the pod (/health).
In single-instance mode with the default in-memory session store, /ready always returns 200 OK as long as the process is up. The 503 behavior is only active when session_store=redis.

Prometheus metrics

Voxray exposes metrics at GET /metrics in Prometheus text exposition format. Point a Prometheus scrape job at this endpoint.

Enabling and disabling

Metrics are enabled by default. To disable:
When disabled, the /metrics endpoint returns 404. Re-enable by removing the key or setting it to true.

Prometheus scrape config

For Kubernetes, use the Prometheus Operator ServiceMonitor or annotate the pod with prometheus.io/scrape: "true" and prometheus.io/port: "8080".
/metrics is unauthenticated by default. It exposes internal performance data that could reveal information about your AI providers, session volumes, and error rates. Restrict access using a firewall rule, nginx allow/deny directives, a Kubernetes NetworkPolicy, or a VPN. Do not expose /metrics directly to the public internet.

Metric reference

HTTP metrics

These metrics cover all HTTP traffic into Voxray, including WebSocket upgrade requests and REST endpoints.

AI pipeline metrics

Voxray instruments every stage of the STT → LLM → TTS pipeline with latency histograms and error counters. All pipeline metrics carry a model label so you can compare provider performance without separate dashboards.

Speech-to-text (STT)

Large language model (LLM)

Text-to-speech (TTS)

WebRTC metrics

Recording metrics

Label cardinality

The session_id label is passed through SampledSessionID() before being applied to any metric. This function either SHA-256 hashes the raw ID to a fixed-length hex string, or returns the constant "sampled_out" when the configured sample rate causes the session to be excluded. This prevents high-cardinality session IDs from creating unbounded time-series in Prometheus. You do not need to configure this separately — it is applied automatically inside the metrics package.
The label set across all metrics is: session_id (hashed/sampled), stage, direction, status, model. For HTTP metrics, method, route, and status_code replace the pipeline-specific labels.

Alerting

The following alerts cover the most operationally significant failure modes. Add them to your Prometheus alerting rules or import them into Grafana.

Structured logging

Log format

The default log format is human-readable text, suitable for local development and tailing with docker logs or kubectl logs.

Log levels

Override at runtime without redeploying by setting VOXRAY_LOG_LEVEL in the environment. The environment variable takes precedence over the config file value.

Log shipping

Voxray writes logs to stdout. Ship them from stdout to your preferred backend using any standard log collector:
Use the Promtail agent or the Loki Docker driver to tail container stdout and push to Loki. With json_logs: true, Promtail can parse fields automatically using json pipeline stages:
Always run with json_logs: true and log_level: info in production. Text logs are harder to parse programmatically, and debug level generates very high log volume (one entry per audio frame in some paths).