Monitor Policy and Service Health
Monitoring APF means answering three questions: are the services up, is every host enforcing the policy you published, and is anything being refused that should not be. APF answers them through health endpoints, audit records, and logs.
Service Health
The HTTP surface is optional. Without it, use the gRPC Health RPC from a process running as the service account, or check that the socket exists. The policy gateway has no HTTP endpoint. The local container stack checks it with test -S on its socket.
Health routes need no token. Keep the HTTP port bound to loopback, and do not expose it off the host for monitoring. Use a local agent or a narrow proxy that forwards only the health routes.
Policy Freshness
A host is enforcing the policy you published when the same revision appears at every stage. Compare policy_revision:
A gateway revision that stays lower than the policy service revision for longer than the gateway’s refresh interval has several possible causes. The update changed no rules, annotators, effects, or findings, so the gateway saw no change, which is expected. The gateway could not fetch, decode, or build the new policy set; check its log for get_document failed on hot-swap, PolicySet decode failed on hot-swap, or evaluator rebuild failed. The change landed before the gateway’s first poll after startup. Or bundle refresh is disabled with --bundle-refresh-interval-secs 0, or the gateway cannot reach the policy service; check its log for digest watcher: get_document failed. Refer to Policy Updates Do Not Take Effect. Sandboxes with a lower revision were admitted before the update and have not been refreshed.
Also track expires_at for the active bundle. APF does not warn before a bundle expires. Refer to Expiry and Rollback Protection.
Signals to Alert On
From Audit Records
From Logs
Some conditions appear only in the services’ logs, which go to standard output and are filtered with RUST_LOG, info by default:
- The gateway logs
evaluator rebuild failed,PolicySet decode failed on hot-swap, orget_document failed on hot-swapwhen it keeps its previous evaluator after a bad update. - The gateway logs
digest watcher: get_document failedwhen it cannot reach the policy service. - The policy service logs
poll failed for variantwhen the HTTP source cannot fetch. - The gateway exits if it cannot record a policy hot swap. Alert on unexpected restarts.
Metrics and Capacity
In development. APF does not expose a metrics endpoint in this release, and capacity and performance guidance is not yet in the repository. Use the health checks, audit records, and logs above.
Next Steps
- To act on these signals, refer to Troubleshooting.
- To ship audit records to your monitoring system, refer to Export Audit Events.