For AI agents: Documentation index at /llms.txt

Skip to content

Observability and Monitoring

Without monitoring, it can be hard to detect attacks or vulnerabilities that are being actively exploited. For example, a sudden increase in cycles consumption could indicate a DoS attack, while unexpected changes in canister state could indicate a security breach.

  • Monitor your canister’s cycles balance regularly, set up alerts for sudden changes in cycles consumption, and add an endpoint to expose health indicators. See the DoS prevention best practices for more context on cycles monitoring.

  • Consider emitting logs for security-relevant events (e.g., access control failures, unexpected state transitions). Since logs are stored on-chain, they provide a tamper-resistant audit trail.

  • See effective Rust canisters for general patterns on canister observability.