Docker container (docker_container)
Reports one container of a Docker host: whether it is running, its health check, how often it was restarted, how long it has been up, and its CPU and memory use. It reads the Docker Engine API over TLS with a client certificate, the way the daemon is meant to be exposed on a network. It only reads: it starts, stops and changes nothing.
What it looks like

The page of a Docker container sensor after a few polls, watching a container with a health check and a memory limit on a lab host. In the dark theme: the sensor's page. The form for adding it, with its parameters filled in: light, dark.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
state | State: 0 Missing, 1 Created, 2 Running, 3 Paused, 4 Restarting, 5 Removing, 6 Exited, 7 Dead, 8 Unknown | Running is up; Paused and Removing are warnings; every other state is down | |
health | Health check: 0 none, 1 Starting, 2 Healthy, 3 Unhealthy | Unhealthy is down | |
restart_count | Restarts since the container was created (Docker's own counter of automatic restarts) | none | |
restarts_new | Restarts since the previous poll (unknown for the first poll, and when the count went down because the container was created again) | warning above 0 | |
uptime_s | Time since the container started (while it runs) | s | none |
exit_code | Exit code of the last run (while it is stopped) | none | |
cpu_pct | CPU, as docker stats prints it: 100 is one core fully used, 400 is four | % | none |
memory_bytes | Memory in use, without the page cache the kernel can take back | B | none |
memory_pct | Memory use as a share of the container's memory limit, or of the host's memory when it has no limit | % | warning above 90, error above 98 |
response_ms | Time the API took | ms | warning above 3000, error above 10000 |
A container that is stopped, restarting, paused or unhealthy is a reading, not a failed poll: the sensor is Down or Warning with the state in its message (... is exited, exit code 1, restarted 2 time(s), and killed for lack of memory when the kernel did that). A container that does not exist is Down too, with state 0, because a container someone removed is what the sensor is there to notice. The CPU and memory channels are unknown while the container does not run. CPU and memory cost the daemon about a second of sampling per poll; set stats to false to leave them out.
The default memory_pct limit suits a container with a memory limit that it should stay clear of. A database that fills its cache on purpose will want other limits, set on the sensor. restart_count only counts the restarts the daemon's restart policy made, and never goes down, so alert on restarts_new, or set a limit on restart_count that suits the container.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
container | required | The container's name, or its id (the whole id or its first digits). Letters, digits, _, . and -. |
port | 2376 (2375 with allow_insecure) | TCP port of the Docker API. |
allow_insecure | false | Talk plain HTTP. Strongly discouraged, see plain HTTP. |
verify_tls | true | Check the server's certificate against the authority in the credential, or the system's trust store when the credential has none. Ignored when tls_fingerprint is set. |
tls_fingerprint | none | The SHA-256 fingerprint of the one server certificate to accept, instead of checking the chain. Not with allow_insecure. |
stats | true | Read CPU and memory. |
Suggested interval: 60 seconds. Credential: a tls_client credential, inherited as the TLS client credential of the sensor, its device or a group above it. It is needed unless allow_insecure is set.
The credential: a client certificate
A tls_client credential holds three pieces of PEM text, pasted into its form or sent to the API:
| Field | What |
|---|---|
certificate | The client certificate the daemon trusts, followed by any intermediate certificates. |
private_key | Its private key, without a passphrase (PRIVATE KEY, RSA PRIVATE KEY or EC PRIVATE KEY). |
ca_certificate | Optional. The authority that issued the daemon's certificate. Without it the system's trust store on the probe host decides. |
They are stored encrypted like every credential and never shown again. Use a certificate of its own for Probeward. A client certificate is as powerful as the API: whoever holds it can control Docker on that host, and the sensor only ever reads. Give a credential like this an allowed address range of the Docker hosts.
On the target
The daemon has to listen on a TCP port with TLS and require client certificates. With a systemd install that listens on the socket (-H fd://), add a drop-in so that the socket keeps working, for instance docker.service.d/tls.conf:
[Service]
ExecStart=
ExecStart=/usr/sbin/dockerd -H fd:// -H tcp://192.0.2.31:2376 --tlsverify \
--tlscacert=/etc/docker/tls/ca.pem --tlscert=/etc/docker/tls/server-cert.pem --tlskey=/etc/docker/tls/server-key.pem \
--containerd=/run/containerd/containerd.sock(Copy the ExecStart of your own unit and add the flags: ExecStart= on its own line clears the original.) Then systemctl daemon-reload && systemctl restart docker. Restarting the daemon stops the containers that do not have a restart policy, and restarts those that do; set live-restore in daemon.json first if that matters. The server certificate needs the address or name the sensor connects to in its subject alternative names (the device's host name when it has one, else its address), and extendedKeyUsage=serverAuth; the client certificate needs clientAuth. Bind the port to the management address, not to every interface, and let only the probe reach it.
A host name stored on the device is used in the URL and so for checking the certificate; the connection goes to the device's address.
Plain HTTP
The daemon can also listen on plain TCP, conventionally 2375. Do not do this on a network you do not fully control. That port has no authentication: anyone who can reach it can start a privileged container and take the host, and anyone on the path can read and change what it says. Probeward therefore never sends a plain request unless the sensor sets allow_insecure itself, no credential is sent with it, and every message of such a sensor ends with a warning. The setting exists for a daemon on the same machine or on an isolated management network that cannot be changed, and for nothing else. Prefer the socket proxy or the TLS port.
Discovery: one sensor per container
Discovery recognises a Docker host by its TLS port, 2376, accepting a connection. Without a credential it proposes a TCP check for the port and says that a credential would find more. Offer a tls_client credential (Discovery, step Credentials) and discovery reads the container list with it, and proposes a docker_container sensor for each container, named Container <name>:
- Running containers are selected. Stopped ones are listed but not selected, so that a container someone stopped on purpose does not page; tick them in the results if you want them.
- Each sensor pins the certificate the daemon presented (its fingerprint is in the sensor's
tls_fingerprintand in the check line of the results), and the credential that worked is stored as the device's TLS client credential. Discovery trusts that certificate for the scan because you asked it to look at this address; compare the fingerprint with the daemon's own if the network between is not yours. - A second run proposes nothing new, and a container that was added since is proposed alone. A sensor is tied to the container's name: a container that is recreated under the same name (a
docker compose up) is the same sensor. - A refused credential is reported with the reason, and the next one offered is tried. At most 256 containers are listed, and a container whose name the sensor would not accept is left out.
The port is only found when it is among the TCP ports discovery tries; 2376 is one of the defaults.
Failures
| Message | Meaning |
|---|---|
a refused connection (kind unreachable), a timeout (kind timeout) | The daemon does not listen on that port, or a firewall drops the traffic. |
TLS error: the server did not accept the client certificate ... (kind protocol) | The certificate is not issued by the authority the daemon was started with (--tlscacert), or none was sent. |
TLS error: the certificate is not trusted ...; to trust exactly that certificate, set tls_fingerprint to it (kind protocol) | The daemon's certificate is from an authority the sensor does not know: put that authority in the credential. |
TLS error: the port does not speak TLS (kind protocol) | The port is the plain one: use the TLS port, or allow_insecure. |
the Docker daemon answered HTTP 403: ... (kind auth_failed) | An authorisation plugin refused the request. |
this sensor needs a tls_client credential ... and none is assigned (kind config) | Assign one, or set allow_insecure. |
the tls_client credential: ... (kind config) | The certificate or key is not usable PEM. The text of the credential is never in the message. |
the answer does not describe a container: is this port the Docker Engine API? (kind protocol) | The port answers something else. |
Verification
Checked against answers recorded from a Docker Engine 26.1 daemon on Debian 13 (a running container under a CPU and a memory limit, one with a passing and one with a failing health check, one that exited after being restarted twice by its policy), scripted answers for the failures, and that daemon live over TLS with a client certificate from a lab authority: a container of each state, the CPU figure of a container held to half a core (about 50 %), the memory figure and its limit, a container that does not exist, a client certificate from another authority, a server whose authority the credential does not name, a wrong pin, and plain HTTP sent to the TLS port. Discovery recognised the daemon, read its container list with the certificate, proposed one sensor for each container, and one of those sensors polled as proposed. The Unix socket and every container that ran before the daemon was restarted for TLS were checked afterwards. Not seen: a Windows container host, cgroup v1, Docker Desktop, a daemon behind an authorisation plugin, Podman's Docker-compatible API, a host with hundreds of containers (one sensor reads one container).
Testing
The live tests in crates/probeward-sensors/tests/docker_live.rs need PROBEWARD_TEST_DOCKER_HOST, PROBEWARD_TEST_DOCKER_CERT_FILE, PROBEWARD_TEST_DOCKER_KEY_FILE, PROBEWARD_TEST_DOCKER_CA_FILE and PROBEWARD_TEST_DOCKER_CONTAINER (a running container), with PROBEWARD_TEST_DOCKER_PORT if the TLS port is not 2376. PROBEWARD_TEST_DOCKER_BUSY (a running container that uses CPU and has a memory limit), PROBEWARD_TEST_DOCKER_HEALTHY, PROBEWARD_TEST_DOCKER_UNHEALTHY and PROBEWARD_TEST_DOCKER_STOPPED each switch on the check that needs a container in that state. They skip cleanly without them.