Metrics & Health
On this page 4 sections
QSCS exposes local Prometheus metrics at GET /qscs/metrics on its HTTP listener (normally port 8080). Traffic counters use the same events that feed the monitoring API. Scraping is read-only: it does not drain the reporting buffer, contact the monitoring service, probe an origin or flush the cache.
Local counters work for registered and unregistered nodes, including when remote monitoring is disabled or unavailable. Counters reset when the daemon process restarts; Prometheus retains the historical samples. SpookVis remains the account-scoped service for historical traffic, visitor geography, browser sessions and fleet-wide health. Its time windows, filtering and hostname grouping mean its displayed totals need not equal one node's lifetime counters.
Scraping safely
The endpoint requires an actual loopback connection and a Host of 127.0.0.1 or localhost. Forwarded requests and requests using a public origin hostname return 404, even through a local reverse proxy. Responses use Cache-Control: private, no-store. Do not publish this route through application ingress.
scrape_configs:
- job_name: qscs
metrics_path: /qscs/metrics
scrape_interval: 30s
static_configs:
- targets: ['127.0.0.1:8080']
On a server, run a local Prometheus-compatible collection agent. In Kubernetes, an agent sidecar in the same Pod can scrape the listener over loopback and forward samples to your central metrics store. A Prometheus server in a different Pod cannot scrape this endpoint directly. A generic node_exporter does not automatically collect QSCS metrics.
Keep each node as a separate scrape target. Do not scrape through a shared application load balancer: consecutive samples could come from different nodes and make counters appear to reset. Collection agents can attach deployment and region labels; QSCS supplies its own node UUID, version, configured domain, substrate ID where available and startup role in qscs_node_info.
Labels never include visitor IP addresses, request paths, queries, user identities, keys or license tokens. Traffic labels use configured origin names; unknown hosts share origin="". Modes and status values are bounded. Origin names retain their configured spelling, so www.example.com and example.com are separate local series.
Key metrics
| Metrics | Type | Meaning |
|---|---|---|
qscs_node_info, qscs_uptime_seconds, qscs_start_time_seconds | gauge | Node identification, monotonic uptime and process start time. The info role describes startup configuration. |
qscs_http_requests_total, qscs_http_responses_total | counter | Recorded application traffic events by origin; responses also include delivery mode and HTTP status. Stream updates count as events. Scrapes, synthetic probes and early administrative or routing rejections are excluded. |
qscs_http_response_bytes_total, qscs_http_payload_bytes_total | counter | API-recorded response bytes (generally HTTP headers plus encoded body) and measured full body bytes before delta encoding. Neither includes TLS or TCP overhead. |
qscs_http_reported_wire_bytes_total | counter | The API's X-QSCS-Wire-Bytes measurement. A cache hit can report zero while still sending a full body to the browser; this is not a network-interface bandwidth counter. |
qscs_cache_hits_total, qscs_cache_misses_total | counter | Successful, cache-eligible events using SpookVis classification. Edge hits and smaller measured deltas count as hits; a full origin revalidation remains a miss. Missing byte measurements never earn delta savings. |
qscs_cache_bypasses_total, qscs_cache_unclassified_total | counter | Bypassed and unclassified successful events, kept out of the cache-efficiency denominator. |
qscs_origin_saved_bytes_total, qscs_client_saved_bytes_total | counter | Estimated origin offload from eligible edge hits, and measured client-body savings from smaller 2xx delta/no-change responses. Proxy delta savings affect client savings, not origin offload. |
qscs_http_handling_duration_seconds | histogram | Measured response handling from HTTP worker start to traffic recording. Excludes queue time, transport overhead and later stream updates. Depending on the response path, recording can precede the final socket send. |
qscs_replication_acknowledgements_total | counter | Outbound deliveries acknowledged by replication peers, including retries acknowledged after a lost acknowledgement. It is not a byte count or an inbound replication count. |
qscs_operational_requests_total, qscs_operational_cache_hits_total, qscs_operational_origin_requests_total | counter | The existing operational API counters. Its compact cache-hit definition covers hit/persisted/headless; its origin-request field counts other events with positive reported wire bytes. Use the classified cache counters above for cache efficiency, not these compatibility totals. |
qscs_origin_enabled, qscs_origin_health_known, qscs_origin_degraded | gauge | Serving policy, verified health availability and degraded state by origin/backend. Deliberately paused origins have enabled/known/degraded set to zero; unknown health is not proof of health. |
qscs_origin_failures_total, qscs_origin_headless_requests_total, qscs_origin_consecutive_failures | counter / gauge | Upstream failures including probes, headless responses and current failure streak. Cumulative counters are retained while paused; the displayed streak is zero while paused. |
qscs_origin_probes_total, qscs_origin_probe_failures_total, qscs_origin_probe_success, qscs_origin_probe_last_timestamp_seconds, qscs_origin_probe_last_duration_seconds | counter / gauge | Background upstream health checks in healthy and degraded states. A timestamp of zero means no completed probe; success is zero while paused. Check timestamp freshness before interpreting duration. |
qscs_node_probe_success, qscs_node_probe_last_timestamp_seconds, qscs_node_probe_ttfb_seconds, qscs_node_probe_duration_seconds | gauge | The last scheduled loopback node-handling measurements sent to the probe API, converted to seconds. They do not measure upstream latency. Series are absent before a scheduled measurement or when that reporting path is not enabled; failed timing measurements are not invented as zero. |
qscs_cache_entries, qscs_cache_bytes, qscs_cache_limit_bytes | gauge | Resident response-cache entries, estimated resident bytes including metadata, and configured memory budget. This is not on-disk usage or whole-process memory. A zero budget means unlimited. |
qscs_cache_checkpoint_*, qscs_cache_checkpoints_total | counter / gauge | Checkpoint activity, pending mutations, completed checkpoints, bytes written, failures and last duration. The old last_duration_ms gauge remains available alongside last_duration_seconds. |
qscs_http_active_workers, qscs_http_worker_limit, qscs_http_worker_rejections_total | gauge / counter | Queued/executing HTTP workers, their cap and overload rejections. The active-worker value includes the scrape itself. |
qscs_telemetry_reporting_enabled, qscs_telemetry_buffer_events, qscs_telemetry_buffer_dropped_total | gauge / counter | Whether remote event collection is enabled, queued visitor events and overflow evictions. Enabled does not imply that the monitoring API is reachable; dropped counts cover buffer overflow only. |
Every exposed family includes HELP and TYPE metadata. Samples use the Prometheus text exposition format. Counter values are cumulative; use rate() for throughput and increase() for totals over a selected period.
Queries and alerts
# Request event rate per origin
sum by (origin) (rate(qscs_http_requests_total[5m]))
# Classified cache hit ratio (no eligible traffic gives no meaningful ratio)
sum by (origin) (rate(qscs_cache_hits_total[5m]))
/
sum by (origin) (rate(qscs_cache_hits_total[5m]) + rate(qscs_cache_misses_total[5m]))
# Measured client bytes saved per second
sum by (origin) (rate(qscs_client_saved_bytes_total[5m]))
# Approximate p95 response handling time, seconds
histogram_quantile(0.95,
sum by (origin, le) (rate(qscs_http_handling_duration_seconds_bucket[5m])))
# Degraded active origin: apply an alert duration such as for: 2m
(qscs_origin_degraded == 1) and (qscs_origin_enabled == 1)
Prometheus provides up for scrape availability. Use that to detect a missing node. Keep origin-health alerts gated by qscs_origin_enabled so deliberately stopped origins do not trigger failure alerts. A rise in qscs_http_worker_rejections_total, checkpoint failures or telemetry buffer drops warrants investigation.
Quick health check from the host
curl --fail --silent http://127.0.0.1:8080/qscs/metrics