Stats API
The stats endpoints provide Docker container statistics, host system metrics, and container log access.
Endpoints
GET /stats
Returns comprehensive system information including Docker stats, host metrics, and per-container resource usage.
Response (200):
{
"timestamp": "2026-02-14T06:19:07.261Z",
"docker": {
"containers": "17",
"running": "17",
"images": "29",
"serverVersion": "29.2.1"
},
"host": {
"load1": 0.95,
"load5": 1.2,
"memPercent": 2,
"memUsed": 1073741824,
"memTotal": 53687091200
},
"containers": [
{
"name": "nexus-frontend",
"state": "running",
"status": "Up 3 days",
"cpu": "0.15%",
"mem": "128MiB / 512MiB"
}
]
}
GET /stats/logs/:name
Fetch the last 50 log lines from a specific container.
Parameters:
:name— Container name (e.g.,nexus-api,nexus-auth)
Response (200):
{
"container": "nexus-api",
"logs": "✓ backend running on port 4000\n..."
}
GET /health
Simple health check endpoint.
Response (200):
{
"service": "backend",
"status": "healthy",
"port": 4000,
"uptime": 86400,
"timestamp": "2026-02-14T06:19:07.261Z"
}
GET /status
Service version and operational status.
Response (200):
{
"service": "backend",
"version": "1.0.0",
"description": "API Gateway",
"status": "operational",
"timestamp": "2026-02-14T06:19:07.261Z"
}