Observability and Monitoring
Monitor your canister
Section titled “Monitor your canister”Security concern
Section titled “Security concern”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.
Recommendation
Section titled “Recommendation”-
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.