Skip to content

Add container health to list containers API response for ease of monitoring #50253

@binaryfire

Description

@binaryfire

Description

It'd be great if the list containers endpoint included the container's health status. Currently, monitoring containers requires multiple API calls.

  1. Call /containers/json to get running containers
  2. Separate calls to {id}/stats for each container to get resource usage
  3. Separate calls to {id}/json for each container to get the health status

Including it in stats would also be an improvement, but I think including it in the container lists response makes the most sense. That way you could monitor the health of all containers on a host using a single endpoint:

[
  {
    "Id": "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf",
    "Names": [],
    "Image": "docker.io/library/ubuntu:latest",
    "ImageID": "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782",
    "ImageManifestDescriptor": {},
    "Command": "/bin/bash",
    "Created": "1739811096",
    "Ports": [],
    "SizeRw": "122880",
    "SizeRootFs": "1653948416",
    "Labels": {},
    "State": "running",
    "Health": "healthy",
    "Status": "Up 4 days",
    "HostConfig": {},
    "NetworkSettings": {},
    "Mounts": []
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiAPIhelp wantedkind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shinystatus/0-triage

    Type

    No type

    Projects

    Status

    Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions