---
title: "Inspect a service's container(s): status, restart count, OOM-killed flag, exit code, and the cgroup limits actually applied."
method: GET
path: "/external-services/{id}/runtime"
tags: ["External Services"]
---

# Inspect a service's container(s): status, restart count, OOM-killed flag, exit code, and the cgroup limits actually applied.

`GET /external-services/{id}/runtime`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/external-services/{id}/runtime`
- Auth: none declared

## Path parameters

- `id` integer, required

## Response `200`

Container runtime snapshot

- ServiceRuntimeReport: Aggregate runtime info for an external service. For standalone services, `members` has exactly one entry. For clusters, one entry per member.
  - `members` ContainerRuntimeInfo[], required
    - `container_id` string, nullable: Container Docker id, when present. None = container does not exist (was never created or was removed externally).
    - `container_name` string, required: Stable name of the Docker container (e.g. `postgres-mydb`).
    - `exit_code` integer, nullable: Last container exit code, when known. Non-zero = unclean stop.
    - `finished_at` string, nullable: ISO-8601 timestamp of the most recent termination, when known.
    - `image` string, nullable: Currently-effective Docker image (e.g. `gotempsh/postgres-walg:18-bookworm`).
    - `oom_killed` boolean, nullable: True when the container's last termination was caused by the kernel OOM killer. Set if the user enabled hard memory limits and the working set exceeded them.
    - `resource_limits` ServiceResourceLimits, required: Currently-applied resource limits read off the container's `HostConfig`. Compare this against the user-configured limits to detect drift (an old container that never picked up new caps).
      - `cpu_shares` integer, nullable: Relative CPU weight (default 1024). Only used when `nano_cpus` is None.
      - `memory_mb` integer, nullable: Hard memory limit in MiB. None = unlimited.
      - `memory_swap_mb` integer, nullable: Memory + swap limit in MiB. None = unlimited. MUST be >= memory_mb when both are set; Docker rejects the request otherwise. Set equal to `memory_mb` to disable swap entirely.
      - `nano_cpus` integer, nullable: CPU quota in nano-cpus. 1_000_000_000 = 1 full CPU core. None = unlimited.
      - `shm_size_mb` integer, nullable: Shared memory (/dev/shm) size in MiB. None = Docker default (64 MiB). Maps to HostConfig.shm_size (bytes). PostgreSQL uses /dev/shm for parallel query workers and large work_mem; the 64 MiB default causes "could not resize shared memory segment ... No space left on device" under load. NOTE: shm_size is fixed at container-create time — Docker's live update API cannot change it, so changing this value recreates the container.
    - `restart_count` integer, nullable: Total restarts since the container was created. Useful for detecting crash loops — a steady stream means something is killing the container repeatedly (frequently OOM).
    - `role` string, required: `service_members.role` for cluster members; "standalone" otherwise.
    - `started_at` string, nullable: ISO-8601 timestamp of when the container last started. None when it has never started (i.e. created but never run).
    - `status` string, nullable: Bollard container state ("running", "exited", "dead", etc.). None when the container does not exist.
    - `unavailable_reason` string, nullable: Why the fields above could not be read, when they could not: this server has no Docker daemon for a local container, the agent on the container's node could not be reached, or it is too old to report this. `None` with an empty `container_id` means the container does not exist.
  - `service_id` integer, required
  - `topology` string, required

## Other responses

- `404`: Service not found
- `500`: Internal server error

## Changes

- **2026-11-12** `e052e98bb073`: 1 info
  - added the optional property `members/items/unavailable_reason` to the response with the `200` status
- **2026-07-01** `d83dcb738585`: 1 info
  - added the optional property `members/items/resource_limits/shm_size_mb` to the response with the `200` status
- **2026-05-30** `b72341d12f63`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/external-services/:id/runtime/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
