Architecture position
Responsibilities
- Resolve the
X-Deployment-Idheader to a deployment and a running instance in the same region - Evaluate middleware policies (KeyAuth, rate limiting, IP rules) before proxying
- Forward requests to the selected instance and stream responses back
- Record request telemetry to ClickHouse and expose Prometheus metrics
- Categorize proxy errors and return structured error responses
Why sentinel is a separate service
Sentinel exists as a distinct service from Frontline for five reasons:- Isolation. A misconfigured policy or a misbehaving deployment affects only its own environment. Frontline stays thin and stable.
- Scaling. Frontline scales with total ingress traffic across all customers. Sentinel scales with a single environment’s traffic and policy complexity. These are different axes.
- Cache efficiency. A per-tenant sentinel only caches deployments, instances, and keys for its own environment. The working set is small enough to prewarm on startup and keep entirely in memory, resulting in high cache hit rates. A shared gateway would need to cache data across all tenants, leading to lower hit rates, more eviction, and higher tail latency from cache misses.
- Separation of concerns. Frontline owns TLS, DNS routing, and regional failover. Sentinel owns the middleware engine, instance selection, and per-request telemetry. Keeping these apart reduces the blast radius of changes to either.
- Security boundary. Sentinel validates that a deployment belongs to its environment (returns 404, not 403, to avoid leaking information). It strips client-supplied
X-Unkey-Principalheaders to prevent principal spoofing.
Related pages
- Request flow for the full lifecycle of a proxied request
- Configuration for all config fields and defaults
- Deployment for how Krane manages sentinel in Kubernetes
- Failure modes for what can go wrong and how to diagnose it
- Frontline ingress for the layer that sits in front of sentinel

