Files
coder/coderd/database/migrations/000289_agent_resource_monitors.up.sql
Vincent Vielle 7cbd77fd94 feat: improve resources_monitoring for OOM & OOD monitoring (#16241)
As requested for [this
issue](https://github.com/coder/internal/issues/245) we need to have a
new resource `resources_monitoring` in the agent.

It needs to be parsed from the provisioner and inserted into a new db
table.
2025-02-04 18:45:33 +01:00

17 lines
588 B
SQL

CREATE TABLE workspace_agent_memory_resource_monitors (
agent_id uuid NOT NULL REFERENCES workspace_agents(id) ON DELETE CASCADE,
enabled boolean NOT NULL,
threshold integer NOT NULL,
created_at timestamp with time zone NOT NULL,
PRIMARY KEY (agent_id)
);
CREATE TABLE workspace_agent_volume_resource_monitors (
agent_id uuid NOT NULL REFERENCES workspace_agents(id) ON DELETE CASCADE,
enabled boolean NOT NULL,
threshold integer NOT NULL,
path text NOT NULL,
created_at timestamp with time zone NOT NULL,
PRIMARY KEY (agent_id, path)
);