Admin API¶
PRISM includes a built-in admin API for health checks, monitoring, cache management, and manual rendering.
Configuration¶
The admin API runs on a separate port from the proxy. By default it binds to 127.0.0.1 (localhost only).
Authentication¶
When bearer_token is set, all admin requests require the Authorization header:
Endpoints¶
GET /health¶
Health check. Returns 200 if PRISM is running and Chrome is responsive.
GET /status¶
Detailed status including uptime, cache stats, Chrome pool stats, and render counts.
{
"uptime_secs": 3600,
"cache": {
"entries": 1234,
"memory_bytes": 52428800,
"hit_rate": 94.2,
"hits": 45231,
"misses": 2847
},
"pool": {
"tabs": 8,
"active_renders": 3,
"queued": 0,
"total_renders": 48078,
"recycled_tabs": 961
},
"circuit_breaker": "closed",
"render_errors": 12
}
GET /metrics¶
Prometheus-format metrics for Grafana dashboards.
# HELP prism_renders_total Total render requests
# TYPE prism_renders_total counter
prism_renders_total 48078
# HELP prism_render_duration_seconds Render duration histogram
# TYPE prism_render_duration_seconds histogram
prism_render_duration_seconds_bucket{le="0.5"} 12000
prism_render_duration_seconds_bucket{le="1.0"} 35000
prism_render_duration_seconds_bucket{le="2.0"} 45000
prism_render_duration_seconds_bucket{le="5.0"} 47800
prism_render_duration_seconds_bucket{le="10.0"} 48078
# HELP prism_cache_hit_ratio Cache hit ratio
# TYPE prism_cache_hit_ratio gauge
prism_cache_hit_ratio 0.942
POST /purge/url¶
Purge a single cached URL.
curl -X POST http://localhost:4001/purge/url \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "/products/shoes"}'
POST /purge/pattern¶
Purge cached URLs matching a glob pattern.
curl -X POST http://localhost:4001/purge/pattern \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"pattern": "/products/**"}'
POST /purge/all¶
Flush the entire cache.
POST /render¶
Manually trigger a render for a URL. Useful for cache warming.
curl -X POST http://localhost:4001/render \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "/products/shoes"}'