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.
This commit is contained in:
Vincent Vielle
2025-02-19 09:11:53 +01:00
committed by GitHub
parent 2a248b171c
commit 52cc0ce523
+38 -1
View File
@@ -1,7 +1,8 @@
terraform {
required_providers {
coder = {
source = "coder/coder"
source = "coder/coder"
version = "2.2.0-pre0"
}
docker = {
source = "kreuzwerker/docker"
@@ -84,6 +85,30 @@ data "coder_parameter" "region" {
}
}
data "coder_parameter" "res_mon_memory_threshold" {
type = "number"
name = "Memory usage threshold"
default = 80
description = "The memory usage threshold used in resources monitoring to trigger notifications."
mutable = true
}
data "coder_parameter" "res_mon_volume_threshold" {
type = "number"
name = "Volume usage threshold"
default = 80
description = "The volume usage threshold used in resources monitoring to trigger notifications."
mutable = true
}
data "coder_parameter" "res_mon_volume_path" {
type = "string"
name = "Volume path"
default = "/home/coder"
description = "The path monitored in resources monitoring to trigger notifications."
mutable = true
}
provider "docker" {
host = lookup(local.docker_host, data.coder_parameter.region.value)
}
@@ -290,6 +315,18 @@ resource "coder_agent" "dev" {
timeout = 5
}
resources_monitoring {
memory {
enabled = true
threshold = data.coder_parameter.res_mon_memory_threshold.value
}
volume {
enabled = true
threshold = data.coder_parameter.res_mon_volume_threshold.value
path = data.coder_parameter.res_mon_volume_path.value
}
}
startup_script = <<-EOT
#!/usr/bin/env bash
set -eux -o pipefail