Operations

Metrics endpoint

Vektor exposes lightweight, in-process operational metrics at /metrics in the Prometheus text exposition format, ready to scrape by Prometheus/Grafana or read by hand while debugging.

Browse documentation

The /metrics endpoint

Every running server exposes metrics at /metrics. The endpoint lives outside the API router, so it is reachable even in API-only deployments and does not require authentication. Point your browser or curl at it:

Terminal
curl http://localhost:8080/metrics

The response uses the Prometheus text/plain; version=0.0.4 content type. Each metric is emitted with its # HELP and # TYPE lines followed by the current value:

/metrics
# HELP vektor_process_uptime_seconds Process uptime in seconds.
# TYPE vektor_process_uptime_seconds gauge
vektor_process_uptime_seconds 3821.44

# HELP vektor_http_requests_total Total number of HTTP requests handled since start.
# TYPE vektor_http_requests_total counter
vektor_http_requests_total 15204

# HELP vektor_websocket_active_connections Currently open realtime WebSocket connections.
# TYPE vektor_websocket_active_connections gauge
vektor_websocket_active_connections 7

Exposed metrics

The snapshot is collected on demand each time the endpoint is scraped. The following series are exposed:

MetricTypeDescription
vektor_process_uptime_secondsgaugeProcess uptime in seconds.
vektor_http_requests_totalcounterTotal HTTP requests handled since start.
vektor_http_requests_per_secondgaugeAverage HTTP requests per second over the last 60s.
vektor_websocket_active_connectionsgaugeCurrently open realtime WebSocket connections.
vektor_spaces_totalgaugeNumber of active spaces.
vektor_users_totalgaugeNumber of registered users.
vektor_process_cpu_user_seconds_totalcounterTotal user CPU time consumed, in seconds.
vektor_process_cpu_system_seconds_totalcounterTotal system CPU time consumed, in seconds.
vektor_process_cpu_seconds_totalcounterTotal CPU time (user + system), in seconds.
vektor_process_cpu_utilization_ratiogaugeRolling 60s CPU usage as a fraction of one core (1.0 = one core fully busy).
vektor_event_loop_delay_secondsgaugeMost recent event loop delay sample, in seconds.
vektor_event_loop_delay_max_secondsgaugePeak event loop delay over the last 60s. Sustained multi-second values mean the loop was blocked, stalling all clients.
vektor_memory_rss_bytesgaugeResident set size (total memory allocated for the process).
vektor_memory_heap_total_bytesgaugeTotal size of the V8 heap.
vektor_memory_heap_used_bytesgaugeUsed size of the V8 heap.
vektor_memory_external_bytesgaugeMemory used by C++ objects bound to JavaScript objects.
vektor_memory_array_buffers_bytesgaugeMemory allocated for ArrayBuffers and SharedArrayBuffers.

Prometheus scrape config

Add a scrape job pointing at your server to collect these metrics:

prometheus.yml
scrape_configs:
  - job_name: vektor
    metrics_path: /metrics
    static_configs:
      - targets: ["vektor.example.com:8080"]

From there, the series are ready to graph in Grafana or alert on. For example, alerting when vektor_event_loop_delay_max_seconds stays above a threshold, or tracking vektor_spaces_total and vektor_users_total growth over time.