Last updated 2026-05-18

Observability

Health

The service implements standard gRPC health checking. Health status is refreshed while the process is running and reports NOT_SERVING if Redis becomes unreachable or required Lua scripts cannot be loaded. Missing Redis scripts are reloaded automatically after Redis restart, failover, or SCRIPT FLUSH.

grpc.health.v1.Health

Reflection

Reflection is enabled so tools such as grpcurl can inspect the service.

grpc.reflection.v1alpha.ServerReflection

Metrics

quota_requests_total{rpc,action,product,allowed,reason}
quota_request_duration_ms{rpc,action,product}
quota_denials_total{action,product,limit_id}
quota_redis_errors_total
quota_idempotency_hits_total
quota_reservations_active
quota_reservations_expired_total
quota_leases_active
quota_overages_total
quota_event_emit_errors_total

Events

Event emission is best-effort and append-only. Postgres event writes use their own short timeout instead of inheriting the caller RPC context, so a completed request does not cancel asynchronous event delivery.

Reservation Expiry

An in-process sweeper expires due reservations from a Redis sorted-set index. Expiry uses stored impact keys, applies REFUND_FULL or CHARGE_FULL policy, and increments quota_reservations_expired_total.