Docs / Agent
Docker containers
On Linux the agent finds the host's Docker containers. Each compose service or long-running container becomes a check that alerts when it exits, turns unhealthy, crash-loops or runs out of memory, and the Docker daemon gets a check of its own. Free in every edition.
What it needs
- uptight-agent 0.10.0 or later on Linux, and central 0.10.0 or later. Upgrade central first (below).
- Docker's socket at
/var/run/docker.sock: the socket itself, not a symlink, owned by root, with group root or docker, and not world-writable. The agent refuses any other socket: it could be a fake engine a local user planted. - The agent running on the host as root. The packaged systemd unit does this.
Not supported yet: a TCP socket or a socket proxy (the agent never reads DOCKER_HOST), and Podman. An agent in a container with the host's socket mounted refuses it, because the container's /etc/group has no docker group with the socket's group id; it works once you add one (groupadd -g <gid> docker). Recipes for these come in a later release.
What the agent reads
Only GET requests on the socket: /_ping, /version, the container list, each container's inspect, and Docker's oom events between two past times. An inspect answer includes the container's environment, command and mounts, but the agent drops them while decoding: they are never kept, logged or sent. It never starts, stops or changes a container. Of the labels it keeps only the compose project, service and container number, org.opencontainers.image.version and .revision, uptight.name and uptight.watch.
It lists the running containers every 10 seconds and all of them every minute, on its own, so a hung socket never delays the agent's other checks.
What becomes an item
- Containers. Each compose service (its replicas grouped) or standalone container becomes an item of kind
containeronce it has existed forlong_running(5 minutes). Its name (identity) is itsuptight.namelabel, else<project>/<service>, else the container name. - The Docker daemon is an item of kind
container-runtime, checked as<host>:docker-daemon. - Only counted, never listed: Kubernetes pods, swarm tasks,
docker compose runone-offs, CI and build containers (GitLab runner, Testcontainers, BuildKit), dev containers and the agent's own container. So aredocker run --rmcontainers and containers with a name Docker made up (such asfocused_turing, without a compose label), unless they have anuptight.nameoruptight.watchlabel. The server page counts them under "Not inventoried".
Two labels let a container speak for itself:
| Label | Effect |
|---|---|
uptight.name=billing-api | Names the item. Containers of one project, or standalone containers, that share it are grouped as replicas. A name shared by different compose projects is ignored (logged once). |
uptight.watch=true | Watch it, whatever its restart policy. If all its containers go, the check is down. |
uptight.watch=false | Ignore it. |
Which containers are watched
For each container item, the first of these that applies decides:
- a decision (Watch or Ignore on Inventory → Containers or Discovered, or the API);
- the first matching discovery rule;
- the
uptight.watchlabel; - the default: watched when any of its replicas has restart policy
alwaysorunless-stopped. Every other container (compose only,on-failure,no) waits for approval, so review apps and CI stacks never page by default.
By default <host>:docker-daemon is watched whenever the agent reports Docker (not with containers.enabled: false). A decision or a rule of kind container-runtime can ignore it. While it is watched, the systemd units docker.service and containerd.service default to ignored ("covered by <host>:docker-daemon"); a decision or rule can still watch them.
A container's check is <host>:container:<identity>, in lower case, with / and every other character outside a-z0-9._- turned into - (shop/web becomes app-01:container:shop-web, uptight.name=Billing API becomes app-01:container:billing-api). It runs every 60 seconds, goes down after 2 failures, recovers after 2, and has severity critical.
When a check goes down or warns
| Status | When |
|---|---|
| down | No container is running, paused or restarting (they exited, are dead, or were created and never started); every replica is unhealthy; 6 crash-loop runs in 10 minutes; or all its containers are gone and the watch was chosen (a decision, a rule, uptight.watch=true or an agent_checks entry). |
| warning | Some replicas are stopped or paused; some are unhealthy; 3 crash-loop runs in 10 minutes; it restarted after an out-of-memory kill in the last 10 minutes (read from Docker's oom events); a health check has been starting for more than 15 minutes; or all its containers are gone and it was watched by default. That check is retired an hour later. |
| up | Otherwise, for example running 2/2 · healthy · nginx:1.27 · up 3h. |
- A crash-loop run is a check run that saw a container restart or a new container appear. A restarting container counts toward the crash loop, not as stopped.
- A deploy is quiet: new containers with a different image reference replacing healthy ones are not a run, and the message says
recreated: nginx:1.27.3 -> nginx:1.27.4. The comparison is by reference (name and tag), not image content: redeploying the same tag, such as:latest, counts as a run, and so does a replacement for a container that had failed. Three of those in 10 minutes can warn. - Restarts caused by restarting dockerd are not counted.
- A compose recreate never flashes "removed": an item is held 30 seconds after its last container goes.
- When the agent starts and a container restarted in the last 10 minutes, its check holds its last status until those restarts leave the window, so an agent restart does not resolve a crash loop only to open it again.
When the Docker daemon is down
When the socket is gone or refused, or Docker does not answer in time, only <host>:docker-daemon goes down, with the reason. The container checks send nothing: they keep their last status, and their page says "No result since …" with a link to the daemon's check. You get one incident that says why, not one per container.
That holds while the agent keeps running. An agent that starts while the daemon is unreachable (a reboot with Docker not up yet, say) has no container list: chosen container checks keep their last status, and default-watched ones are retired an hour later, as for removed containers. They come back once Docker answers.
Health output and secrets
A container check's page shows the last health-check output of an unhealthy or starting container, at most 200 bytes. On the host, before it is sent, credential shapes are replaced with [redacted] (URL passwords, password=, token=, api_key=, Bearer and Basic values and similar), and then so is every value in the agent's secrets file and its UPTIGHT_SECRET_* variables.
Configuration
On the host: agent.yaml
containers:
enabled: auto # auto (the default), true or false
| Value | Means |
|---|---|
auto | Watch Docker when /var/run/docker.sock exists and qualifies. Report nothing otherwise. |
true | The same, but a missing or refused socket shows <host>:docker-daemon down with the reason. |
false | Never connect to the socket. On a host with a qualifying socket the agent reports Docker as disabled: central retires the host's discovered container checks with the reason containers turned off on the agent (containers.enabled: false), and removes <host>:docker-daemon as an ignored item. agent_checks entries of kind container stay and report unknown (containers are off on this host) until you change them. |
Agents older than 0.10.0 reject the containers key. See agent configuration.
In the config repository
Discovery rules take kind: container and kind: container-runtime. A container rule may also select by image:
discovery:
severity: { container: critical, container-runtime: critical }
rules:
- { name: ignore-sidecars, action: ignore, kind: container, image: ["oauth2-proxy/*", "datadog/agent"] }
- { name: shop, action: watch, kind: container, identity: ["shop/*"] }
agent_checks:
- { name: billing-api, kind: container, target: billing/api, severity: critical, on: { host: ["app-*"] } }
defaults:
by_type:
container: { interval: 30s }
- An image pattern is the image name without registry host, Docker Hub's
library/, tag or digest, in lower case:oauth2-proxy/*matchesquay.io/oauth2-proxy/oauth2-proxy:v7.6.0, andnginxmatchesdocker.io/library/nginx:1.25.*matches any text,/included, and?one character. A pattern with a registry host, tag or digest is a config error that says what to write instead, and so isimageon any kind butcontainer. - Once all its containers are gone, a container is still decided by the image it last ran, so an image rule keeps its
severity. - In
identity,*does not cross/:shop/*matchesshop/web. health_urlandexpectare not supported for container kinds.agent_checkstakekind: containerwithtargetset to an identity (no|, no variables). The daemon is watched on its own and is not an agent check kind.- In tag rules,
runs:accepts the barecontainerandcontainer-runtime, nevercontainer:<pattern>. - Older centrals and
uptight validatebinaries reject these kinds andimage: commit them once everything runs 0.10.0.
Where to see them
- Inventory → Containers lists every container, one row per compose service or standalone container, with Watch and Ignore. See Using the web UI.
- A container check's page shows the image, replicas, health, crash-loop runs, out-of-memory kills, the last recreate, the last health-check output and each container's state.
- A server's page has a Containers section: Docker's version and check, how many containers there are and how many are watched, and the ones not inventoried.
- The API:
GET /api/v1/inventory/containers, andcontainersinGET /api/v1/servers/{id}. The MCP toollist_containers. - On the host,
sudo uptight-agent testlists the container items and a line such asRuntimes: docker 29.5.2 (API 1.54) at /var/run/docker.sock · 7 containers, 5 running · 4 items · not inventoried: auto-remove 1, kubernetes 2.
Central keeps each check's latest detail (replicas, health, restarts) in memory. After a central restart or failover it is blank until the next result, normally within a minute. Status, history and incidents are not affected. The hour before a removed default-watched container is retired starts again after a central restart or failover, so it goes a little later, never earlier.
Upgrading
- Central first. An older central drops the containers a 0.10.0 agent sends, and the agent logs
central does not accept containers yet. - Then uptight-web. It shows the Containers tab only once central says it supports containers.
- Then the agents. Central gives container checks only to agents 0.10.0 and later.
An upgraded agent on a host with Docker starts watching the containers whose restart policy is always or unless-stopped, and <host>:docker-daemon, at once. To hold that back, commit ignore rules first, one per kind ({ name: no-containers, action: ignore, kind: container } and { name: no-docker-daemon, action: ignore, kind: container-runtime }), or set containers: { enabled: false } on the host.