Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9251e0d

Browse files
authored
docs: add oom/ood to notifications (#16582)
- [x] add section or to another section: where the notifications show up/how to access previews: - [Notifications - Configure OOM/OOD notifications](https://coder.com/docs/@16581-oom-ood-notif/admin/monitoring/notifications#configure-oomood-notifications) - [Resource monitoring](https://coder.com/docs/@16581-oom-ood-notif/admin/templates/extending-templates/resource-monitoring) --------- Co-authored-by: EdwardAngert <[email protected]>
1 parent edf2889 commit 9251e0d

File tree

3 files changed

+67
-3
lines changed

3 files changed

+67
-3
lines changed

docs/admin/monitoring/notifications/index.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ These notifications are sent to the workspace owner:
2929

3030
### User Events
3131

32-
These notifications sent to users with **owner** and **user admin** roles:
32+
These notifications are sent to users with **owner** and **user admin** roles:
3333

3434
- User account created
3535
- User account deleted
3636
- User account suspended
3737
- User account activated
3838

39-
These notifications sent to users themselves:
39+
These notifications are sent to users themselves:
4040

4141
- User account suspended
4242
- User account activated
@@ -48,6 +48,8 @@ These notifications are sent to users with **template admin** roles:
4848

4949
- Template deleted
5050
- Template deprecated
51+
- Out of memory (OOM) / Out of disk (OOD)
52+
- [Configure](#configure-oomood-notifications) in the template `main.tf`.
5153
- Report: Workspace builds failed for template
5254
- This notification is delivered as part of a weekly cron job and summarizes
5355
the failed builds for a given template.
@@ -63,6 +65,16 @@ flags.
6365
| ✔️ | `--notifications-method` | `CODER_NOTIFICATIONS_METHOD` | `string` | Which delivery method to use (available options: 'smtp', 'webhook'). See [Delivery Methods](#delivery-methods) below. | smtp |
6466
| -️ | `--notifications-max-send-attempts` | `CODER_NOTIFICATIONS_MAX_SEND_ATTEMPTS` | `int` | The upper limit of attempts to send a notification. | 5 |
6567

68+
### Configure OOM/OOD notifications
69+
70+
You can monitor out of memory (OOM) and out of disk (OOD) errors and alert users
71+
when they overutilize memory and disk.
72+
73+
This can help prevent agent disconnects due to OOM/OOD issues.
74+
75+
To enable OOM/OOD notifications on a template, follow the steps in the
76+
[resource monitoring guide](../../templates/extending-templates/resource-monitoring.md).
77+
6678
## Delivery Methods
6779

6880
Notifications can currently be delivered by either SMTP or webhook. Each message
@@ -135,7 +147,7 @@ for more options.
135147

136148
After setting the required fields above:
137149

138-
1. Setup an account on Microsoft 365 or outlook.com
150+
1. Set up an account on Microsoft 365 or outlook.com
139151
1. Set the following configuration options:
140152

141153
```text
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Resource monitoring
2+
3+
Use the
4+
[`resources_monitoring`](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#resources_monitoring-1)
5+
block on the
6+
[`coder_agent`](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent)
7+
resource in our Terraform provider to monitor out of memory (OOM) and out of
8+
disk (OOD) errors and alert users when they overutilize memory and disk.
9+
10+
This can help prevent agent disconnects due to OOM/OOD issues.
11+
12+
You can specify one or more volumes to monitor for OOD alerts.
13+
OOM alerts are reported per-agent.
14+
15+
## Prerequisites
16+
17+
Notifications are sent through SMTP.
18+
Configure Coder to [use an SMTP server](../../monitoring/notifications/index.md#smtp-email).
19+
20+
## Example
21+
22+
Add the following example to the template's `main.tf`.
23+
Change the `90`, `80`, and `95` to a threshold that's more appropriate for your
24+
deployment:
25+
26+
```hcl
27+
resource "coder_agent" "main" {
28+
arch = data.coder_provisioner.dev.arch
29+
os = data.coder_provisioner.dev.os
30+
resources_monitoring {
31+
memory {
32+
enabled = true
33+
threshold = 90
34+
}
35+
volume {
36+
path = "/volume1"
37+
enabled = true
38+
threshold = 80
39+
}
40+
volume {
41+
path = "/volume2"
42+
enabled = true
43+
threshold = 95
44+
}
45+
}
46+
}
47+
```

docs/manifest.json

+5
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,11 @@
401401
"description": "Display resource state in the workspace dashboard",
402402
"path": "./admin/templates/extending-templates/resource-metadata.md"
403403
},
404+
{
405+
"title": "Resource Monitoring",
406+
"description": "Monitor resources in the workspace dashboard",
407+
"path": "./admin/templates/extending-templates/resource-monitoring.md"
408+
},
404409
{
405410
"title": "Resource Ordering",
406411
"description": "Design the UI of workspaces",

0 commit comments

Comments
 (0)