Prometheus Metrics
PRISM exports metrics in Prometheus text exposition format on the admin API at GET /metrics.
Request Metrics
| Metric | Type | Description |
|---|---|---|
prism_requests_total{status="hit|miss|bypass|stale|error"} | counter | Total requests by cache status |
prism_inflight_requests | gauge | Currently processing requests |
prism_rate_limit_rejections_total | counter | Requests rejected by rate limiter (429) |
prism_rate_limit_table_full_total | counter | Per-IP render requests let through untracked because the per-IP limiter had no room for a new client address (100,000 are tracked at once). Non-zero means many distinct client addresses at once; the site-wide limiter, the queue and the tab pool still bound the work. |
Render Metrics
| Metric | Type | Description |
|---|---|---|
prism_render_active | gauge | Currently active renders |
prism_render_queue_depth | gauge | Requests waiting for a Chrome tab |
prism_render_total | counter | Total renders completed |
prism_render_duration_ms | histogram | Render duration in milliseconds |
prism_shadow_renders_total | counter | Shadow renders completed (shadow mode) |
prism_content_validation_failures_total | counter | Renders that failed content validation |
prism_render_duration_ms histogram buckets: 100, 250, 500, 1000, 2500, 5000, 10000, 30000
Cache Metrics
| Metric | Type | Description |
|---|---|---|
prism_cache_entries | gauge | Number of entries in the render cache |
prism_cache_memory_bytes | gauge | Memory used by cached entries |
prism_cache_evictions_total | counter | Cache entries evicted (LRU or TTL) |
prism_cache_stale_if_error_total | counter | Responses served from an expired copy because a fresh render failed, was refused for capacity or met an origin 5xx (cache.stale_if_error_secs) |
prism_cache_refusals_total{reason} | counter | Renders PRISM did not keep, by reason: no_store and private (origin directives), no_cache (origin no-cache), max_age_zero (origin max-age=0 or s-maxage=0), expired (stored, but the origin's Age or Date already exceeds the lifetime, so it is never served fresh), status (status-code rules, including 5xx with error_ttl_secs = 0), cache_disabled, and other (Vary: *, unreadable directives). A rising no_cache, max_age_zero or expired means every crawler request for those pages is rendered again; see cache.ignore_origin_no_cache. |
prism_cache_invalidations_total | counter | URLs whose cached copies were dropped because an unsafe method (POST, PUT, DELETE, PATCH) succeeded on them |
prism_cache_invalidations_refused_total | counter | Invalidations skipped because the client had used its budget of 10 a minute |
Chrome Tab Pool Metrics
| Metric | Type | Description |
|---|---|---|
prism_tab_pool_size | gauge | Total tabs in the pool |
prism_tab_pool_available | gauge | Idle tabs available for rendering |
prism_tab_crashes_total | counter | Tab crashes detected |
prism_tab_creates_total | counter | New tabs created |
prism_tab_recycles_total | counter | Tabs recycled after max renders |
prism_chrome_restarts_total | counter | Full Chrome process restarts |
prism_chrome_launch_failures_total | counter | Chrome launch attempts that failed — the first launch at start-up or any restart. prism_chrome_restarts_total counts only restarts that succeeded, so this is the one that moves when Chrome cannot come up at all. While it climbs, bots get 503 and passthrough traffic is unaffected. |
Origin Metrics
| Metric | Type | Description |
|---|---|---|
prism_origin_requests_total | counter | Requests forwarded to the origin server |
prism_origin_retries_total | counter | Origin requests sent a second time because the origin had closed or reset the connection before answering (GET, HEAD and OPTIONS without a body only) |
prism_origin_duration_sum_ms | counter | Cumulative origin request duration (ms) |
Warmup Metrics
| Metric | Type | Description |
|---|---|---|
prism_warmup_urls_processed | counter | URLs successfully warmed up |
prism_warmup_urls_failed | counter | URLs that failed during warmup |
Circuit Breaker
| Metric | Type | Description |
|---|---|---|
prism_circuit_breaker_state | gauge | 0 = closed (healthy), 1 = open (tripped), 2 = half-open (probing) |
System Metrics
| Metric | Type | Description |
|---|---|---|
prism_uptime_seconds | gauge | Seconds since PRISM started |
prism_build_info{version} | gauge | Always 1. The version label is the PRISM release this instance runs, so one query shows which versions the fleet is on. |
process_resident_memory_bytes | gauge | Resident memory (RSS) of the PRISM process |
process_virtual_memory_bytes | gauge | Virtual memory of the PRISM process |
process_cpu_seconds_total | counter | Total CPU time consumed |
process_open_fds | gauge | Open file descriptors |
process_max_fds | gauge | Maximum file descriptors (ulimit) |
process_threads | gauge | Number of OS threads |
Renderer Internals
| Metric | Type | Description |
|---|---|---|
prism_render_queue_wait_ms | histogram | Time a render waited for a free tab. Distinct from render duration: this is the queue, that is the work. |
prism_render_retries_total | counter | Renders retried after a stalled navigation. One request costing two tabs, so a climb here means the stall is getting more frequent. |
prism_render_incomplete_total{reason} | counter | Renders extracted before the page finished, by reason: selector (the wait_for selector never appeared), network (the networkidle wait ended with the network still busy) or timeout (the wait was cut off by render.timeout_secs). They are served, and cached for render.incomplete_ttl_secs if that is set. |
prism_render_left_origin_total | counter | Renders whose document ended up on another origin than the one navigated to. Each was answered with the origin's own response (x-prism-fallback: left-origin) and nothing was cached. Not a render failure. |
prism_render_failures_total{class} | counter | Render failures by what they say about the shared browser. Only class="systemic" feeds the circuit breaker. |
prism_navigation_duration_sum_ms | counter | Sum of Chrome navigation time — the origin plus its JavaScript. |
prism_html_extract_duration_sum_ms | counter | Sum of DOM serialisation time. Rising against flat navigation means pages got larger, not slower. |
prism_oversize_rejections_total{check} | counter | Documents refused for size, labelled by which check caught them. |
prism_passthrough_not_html_total | counter | Requests proxied unchanged because the origin served non-HTML. Not a failure, but each one cost a Chrome navigation first. |
prism_requests_rejected_total{reason} | counter | Requests shed, by reason: queue_full (the queue was at queue_max, or a request waited out queue_timeout_secs), circuit_open, rate_limited, render_failed. |
prism_rate_limited_total{limiter} | counter | Rate-limit rejections attributed to the ip or domain budget. Which one is shedding is usually the whole question. |
Chrome Process
| Metric | Type | Description |
|---|---|---|
prism_chrome_rss_bytes | gauge | Resident memory of the browser process and all its descendants. process_resident_memory_bytes covers PRISM only, and Chrome is where growth happens. |
prism_chrome_rss_age_seconds | gauge | Age of the RSS sample above. Exported so a stale gauge reads as stale rather than as a current measurement. |
prism_chrome_info{version="…"} | gauge | Always 1; the version label is the version of the browser now running, read after each successful launch. There is one series, and the label changes when a restart or recycle picks up a different browser. PRISM also logs the version at info, and a change at warn. |
prism_chrome_recycles_total | counter | Proactive recycles on age or render budget — routine hygiene, unlike prism_chrome_restarts_total, which counts failures. |
prism_connections_refused_total | counter | Client connections that arrived when server.max_connections was reached. Each one is answered 503 with Retry-After: 1 (when the answer can be written) and closed. |
prism_egress_connections_refused_total | counter | Connections from the browser that the egress proxy refused because it was at its connection cap (the larger of 256 and 64 times render.pool.tabs). Each one is a page subresource that failed to load, so rendered pages can be incomplete while this climbs. PRISM also logs a warning, at most once a minute. |
Licence
| Metric | Type | Description |
|---|---|---|
prism_render_ready | gauge | 1 when this instance can render; 0 while it cannot — Chrome has not launched, has crashed, or the pool has no usable tab — and bots are being answered 503. Visitors are unaffected, and nothing else reports it: the pool gauges keep their last value through a crash loop. The same condition as GET /ready. Alert on it (PrismRenderUnavailable). |
prism_license_valid | gauge | 1 when the licence currently allows rendering; 0 for expired, invalid, or missing licences. |
prism_license_expiry_timestamp_seconds | gauge | When the loaded licence expires, as Unix time. Absent for a perpetual licence and when no licence verifies. Alert on prism_license_expiry_timestamp_seconds - time(): prism_license_valid only changes at expiry, when crawlers have already started receiving the unrendered page. |
prism_license_grace_active | gauge | Legacy compatibility gauge, always 0 since 1.4.5. There is no rendering grace period. |
prism_license_info{status} | gauge | Licence state as a label: valid, trial, expired, no_license, invalid. |
Bots and Fleet
| Metric | Type | Description |
|---|---|---|
prism_bot_verification_total{outcome} | counter | FCrDNS checks of claimed crawlers: verified, spoofed, unverifiable. Rising spoofed is an attack becoming visible; rising unverifiable is your resolver degrading. |
prism_untrusted_forwarded_requests_total | counter | Requests that carried X-Forwarded-For from a peer that is not in server.trusted_proxies and whose address is not publicly routable. The header was ignored. A sustained increase means a proxy in front of PRISM is missing from the list, so PRISM is treating it as the client. |
prism_other_host_render_requests_total | counter | Requests to render, or to serve from the render cache, that arrived under a hostname other than the one in server.public_base_url. Crawlers on that hostname receive the public host's pages. Always zero when public_base_url is unset. See One instance, one public hostname. |
prism_peer_purge_failures_total | counter | Purge fan-outs that failed to reach a replica. Until durable purge lands, the only sign a purge did not converge. |
prism_no_transform_ignored_total | counter | Responses rendered although the origin sent Cache-Control: no-transform. Counted whether or not cache.honor_no_transform is set, so ignoring the directive is a visible decision rather than an omission. Non-zero on a deployment that cares about the letter of RFC 9111 §5.2.2.6 is the signal to turn that setting on. |
prism_background_task_failures_total | counter | Supervisor tasks that exited unexpectedly. The Chrome tasks (crash recovery, liveness watchdog, orphan cleanup, memory sampler) are restarted after a backoff of 1 to 60 seconds and every end is counted; the limiter sweeps are not restarted. A value that keeps climbing means a task fails every time it is restarted and its capability is missing. |
Scrape Configuration
Add PRISM to your Prometheus scrape_configs:
scrape_configs:
- job_name: prism
scrape_interval: 15s
static_configs:
- targets: ['127.0.0.1:4001']
# If bearer_token is configured:
authorization:
type: Bearer
credentials: your-secret-token
Grafana Dashboard
Import this JSON snippet as a Grafana dashboard to get started with key panels:
{
"title": "Trident PRISM",
"panels": [
{
"title": "Cache Hit Rate",
"type": "stat",
"targets": [
{
"expr": "rate(prism_requests_total{status=\"hit\"}[5m]) / (rate(prism_requests_total{status=\"hit\"}[5m]) + rate(prism_requests_total{status=\"miss\"}[5m]))",
"legendFormat": "Hit Rate"
}
],
"fieldConfig": {
"defaults": { "unit": "percentunit", "thresholds": { "steps": [
{ "value": 0, "color": "red" },
{ "value": 0.7, "color": "yellow" },
{ "value": 0.9, "color": "green" }
]}}
}
},
{
"title": "Render Duration (p50 / p95 / p99)",
"type": "timeseries",
"targets": [
{
"expr": "histogram_quantile(0.50, rate(prism_render_duration_ms_bucket[5m]))",
"legendFormat": "p50"
},
{
"expr": "histogram_quantile(0.95, rate(prism_render_duration_ms_bucket[5m]))",
"legendFormat": "p95"
},
{
"expr": "histogram_quantile(0.99, rate(prism_render_duration_ms_bucket[5m]))",
"legendFormat": "p99"
}
],
"fieldConfig": { "defaults": { "unit": "ms" } }
},
{
"title": "Active Renders & Queue Depth",
"type": "timeseries",
"targets": [
{ "expr": "prism_render_active", "legendFormat": "Active" },
{ "expr": "prism_render_queue_depth", "legendFormat": "Queued" }
]
},
{
"title": "Tab Pool",
"type": "timeseries",
"targets": [
{ "expr": "prism_tab_pool_size", "legendFormat": "Total" },
{ "expr": "prism_tab_pool_available", "legendFormat": "Available" }
]
},
{
"title": "Cache Entries & Memory",
"type": "timeseries",
"targets": [
{ "expr": "prism_cache_entries", "legendFormat": "Entries" },
{ "expr": "prism_cache_memory_bytes", "legendFormat": "Memory (bytes)" }
]
},
{
"title": "Circuit Breaker State",
"type": "stat",
"targets": [
{ "expr": "prism_circuit_breaker_state", "legendFormat": "State" }
],
"fieldConfig": {
"defaults": {
"mappings": [
{ "type": "value", "options": { "0": { "text": "CLOSED", "color": "green" } } },
{ "type": "value", "options": { "1": { "text": "OPEN", "color": "red" } } },
{ "type": "value", "options": { "2": { "text": "HALF-OPEN", "color": "yellow" } } }
]
}
}
},
{
"title": "Origin Latency (avg)",
"type": "timeseries",
"targets": [
{
"expr": "rate(prism_origin_duration_sum_ms[5m]) / rate(prism_origin_requests_total[5m])",
"legendFormat": "Avg Origin Latency (ms)"
}
],
"fieldConfig": { "defaults": { "unit": "ms" } }
},
{
"title": "Process Memory",
"type": "timeseries",
"targets": [
{ "expr": "process_resident_memory_bytes", "legendFormat": "RSS" },
{ "expr": "process_virtual_memory_bytes", "legendFormat": "Virtual" }
],
"fieldConfig": { "defaults": { "unit": "bytes" } }
}
]
}
Alerts
The alerting rules ship with the product rather than living here: 19 of them
in deploy/ops/prometheus-rules.yaml (plain Prometheus) and
deploy/ops/prometheusrule.yaml (the Operator CRD), each with a runbook in
deploy/ops/runbooks/. A test keeps every metric they reference in step with
what the binary exports, keeps the two files identical, and fails if any
alert loses its runbook.
This page used to carry its own examples with the same alert names and
different thresholds, which is worse than having none: an operator who copied
both got two rules called PrismCircuitBreakerOpen firing at different
times. Use the shipped set.