Skip to main content

Monitoring and Alerting

You can’t secure what you can’t see. This page covers the key metrics to watch, log collection patterns, and alert rules that help you catch attestation failures, governance anomalies, or KMS downtime before they become incidents.

Key Metrics

KMS Metrics

These metrics tell you whether KMS is healthy and delivering keys promptly:

CVM / Enclave Metrics

Track workload health and resource usage:

Governance Metrics

Governance metrics help you catch stalled proposals or signer inactivity:

Log Collection

dstack-cloud Logs

Use the built-in log viewer:

KMS Logs

KMS logs are available through dstack-cloud logs when the KMS is deployed as a dstack CVM. Key log patterns to monitor:

Infrastructure Logs

GCP:
  • Cloud Logging: gcloud logging read "resource.type=gce_instance AND labels.instance_id=<INSTANCE_ID>"
  • Serial port output for boot diagnostics
AWS Nitro:
  • EC2 instance system logs
  • VSOCK proxy logs (if running as a systemd service)

Dashboard Configuration

  1. KMS Health
    • Request rate (requests/min)
    • Success rate (%)
    • Latency histogram (p50, p95, p99)
    • Active connections
  2. CVM Health
    • Number of running CVMs
    • Per-CVM status (running/stopped/error)
    • Boot time trend
  3. Governance
    • Pending proposals count
    • Recent governance transactions
    • Signer activity heatmap

Integration with Datadog

To integrate with Datadog, you’ll need a Datadog agent on each host machine that collects custom metrics from dstack-cloud. The key metric namespaces are dstack.cloud.cvm.*, dstack.cloud.kms.*, and dstack.cloud.governance.*.
  1. Set up a Datadog agent on each host machine
  2. Configure custom metrics collection for KMS, CVM, and governance events
  3. Create dashboards and monitors based on the metrics above

Alert Rules

Critical Alerts (Page immediately)

Warning Alerts (Page during business hours)

Info Alerts (Log only)

Escalation Policies

Use Incident.io or similar tools to manage incident lifecycle.

On-chain Monitoring

Monitor the blockchain for governance activity:
  • Safe Transaction Service: Subscribe to the Safe’s transaction feed for real-time notifications
  • The Graph / Dune Analytics: Query governance transaction history for reporting
  • Block explorer alerts: Set up watch-only notifications for DstackKms and DstackApp contract events

Next Steps

  • Runbook — Step-by-step troubleshooting for common incidents
  • Upgrade Procedures — How to upgrade CVMs, KMS, and contracts