Skip to content

Commit 5aa526f

Browse files
defelmnqaslilac
authored andcommitted
chore: add resources_monitoring to dogfood (#16600)
As we recently merged OOM & OOD Notifications - we can now enable it in the dogfood instance and workspaces so everyone can use it and help testing it.
1 parent f038790 commit 5aa526f

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

dogfood/contents/main.tf

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
terraform {
22
required_providers {
33
coder = {
4-
source = "coder/coder"
4+
source = "coder/coder"
5+
version = "2.2.0-pre0"
56
}
67
docker = {
78
source = "kreuzwerker/docker"
@@ -84,6 +85,30 @@ data "coder_parameter" "region" {
8485
}
8586
}
8687

88+
data "coder_parameter" "res_mon_memory_threshold" {
89+
type = "number"
90+
name = "Memory usage threshold"
91+
default = 80
92+
description = "The memory usage threshold used in resources monitoring to trigger notifications."
93+
mutable = true
94+
}
95+
96+
data "coder_parameter" "res_mon_volume_threshold" {
97+
type = "number"
98+
name = "Volume usage threshold"
99+
default = 80
100+
description = "The volume usage threshold used in resources monitoring to trigger notifications."
101+
mutable = true
102+
}
103+
104+
data "coder_parameter" "res_mon_volume_path" {
105+
type = "string"
106+
name = "Volume path"
107+
default = "/home/coder"
108+
description = "The path monitored in resources monitoring to trigger notifications."
109+
mutable = true
110+
}
111+
87112
provider "docker" {
88113
host = lookup(local.docker_host, data.coder_parameter.region.value)
89114
}
@@ -290,6 +315,18 @@ resource "coder_agent" "dev" {
290315
timeout = 5
291316
}
292317

318+
resources_monitoring {
319+
memory {
320+
enabled = true
321+
threshold = data.coder_parameter.res_mon_memory_threshold.value
322+
}
323+
volume {
324+
enabled = true
325+
threshold = data.coder_parameter.res_mon_volume_threshold.value
326+
path = data.coder_parameter.res_mon_volume_path.value
327+
}
328+
}
329+
293330
startup_script = <<-EOT
294331
#!/usr/bin/env bash
295332
set -eux -o pipefail

0 commit comments

Comments
 (0)