---
title: "Sample current CPU/memory usage from each of a service's containers. One-shot sample, no streaming. Cheap to call (single Docker round-trip per member) so the UI can poll on a 5–10s interval."
method: GET
path: "/external-services/{id}/stats"
tags: ["External Services"]
---

# Sample current CPU/memory usage from each of a service's containers. One-shot sample, no streaming. Cheap to call (single Docker round-trip per member) so the UI can poll on a 5–10s interval.

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

## 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}/stats`
- Auth: none declared

## Path parameters

- `id` integer, required

## Response `200`

Container stats snapshot

- ServiceStatsReport
  - `members` ContainerStatsSample[], required
    - `container_name` string, required
    - `cpu_percent` number, double, nullable: CPU usage as a percentage. `None` when the container is not running (Docker returns no usable counters).
    - `memory_limit_bytes` integer, nullable: Memory limit in bytes (host RAM if no limit set).
    - `memory_percent` number, double, nullable: Memory usage as a percentage of `memory_limit_bytes`.
    - `memory_usage_bytes` integer, nullable: Resident memory usage in bytes.
    - `online_cpus` integer, nullable: Number of cores Docker observed at sample time. Used by the UI to label "x/y cores" instead of just a percent.
    - `role` string, required
    - `unavailable_reason` string, nullable: Why no sample could be taken, when none could: 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 usage. `None` with empty fields means the container is missing or stopped.
  - `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-05-30** `b72341d12f63`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/external-services/:id/stats/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)
