If you've set up notifications in Coder but the resource monitoring notification isn’t firing when expected — even though the test notification works — the root cause is likely the absence of required resource monitoring configuration in the agent's Terraform setup.
Q: What’s the cause of the notification not triggering?
The "Workspace Out Of Disk" notification relies on disk usage monitoring performed by the Coder agent. For this to work, you must explicitly configure resource monitoring for the agent using the resources_monitoring block in your Terraform coder_agent resource.
Q: How do I enable disk monitoring for workspace agents?
You must add a resources_monitoring block that includes a volume configuration with:
-
enabled– Enable volume monitoring for this agent. -
path– The path of the volume to monitor (e.g.,/home). -
threshold– The volume usage threshold in percentage at which to trigger an alert. Value should be between0and100.
Example Terraform Configuration
resource "coder_agent" "workspace_agent" {
name = "workspace-agent"
resources_monitoring {
volume {
enabled = true
path = "/home"
threshold = 90
}
}
# other agent config...
}
This configuration ensures the agent watches /home, and will raise a "Workspace Out Of Disk" notification when disk usage exceeds 90%.
Q: How do I enable memory monitoring for workspace agents?
You must add a resources_monitoring block that includes a memory configuration with:
-
enabled– Enable memory monitoring for this agent. -
threshold– The memory usage threshold in percentage at which to trigger an alert. Value should be between0and100.
Example Terraform Configuration
resource "coder_agent" "workspace_agent" {
name = "workspace-agent"
resources_monitoring {
memory {
enabled = true
threshold = 90
}
}
# other agent config...
}
This configuration ensures the agent watches the current RAM utilization, and will raise a "Workspace Out Of Memory" notification when RAM usage exceeds 90%.
Q: Why does the test notification work if the real event doesn’t trigger?
The test notification simply confirms that the notification delivery (e.g., to a webhook or Slack) is functioning. It doesn’t validate whether agent-side resource events (like disk thresholds) are configured or detected. That’s why tests can pass while real events silently fail when resources_monitoring is not configured for a workspace agent.