Koo Docs
View as Markdown

Observability

On-demand service logs

GET/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/logs
Rolesreadereditoradminowner
Parameters
filterstringquery

Substring line filter.

limitnumberquery

Max lines (≤1000, default 100).

endstringquery

Absolute window end (ISO). Only meaningful with start; defaults to now.

startstringquery

Absolute window start (ISO). Wins over since; capped to your plan’s retention.

sincestringquery

Relative window, e.g. 1h (capped to your plan’s retention).

namestringpathrequired

Service name within the environment.

environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Returns
200 · LogsResponseDto
serviceIdstringread-only
linesobject[]read-only
truncatedbooleanread-only
sincestring <date-time>read-only

The RESOLVED absolute window start actually queried — after clamping the relative request to your plan’s retention. Honest: never the raw request string.

cURL
GET /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/logs
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/services/:name/logs \  -H "Authorization: Bearer kc_your_api_token"
Response
json
{  "serviceId": "svc_01example0000000000000000x",  "lines": [    {      "ts": "2026-01-01T00:00:00.000Z",      "line": "example",      "stream": "stdout",      "location": "example",      "container": "example"    }  ],  "truncated": true,  "since": "2026-01-01T00:00:00.000Z"}

Account-wide combined log stream

GET/accounts/{accountId}/logs
Rolesreadereditoradminowner

One combined, newest-first log stream across every project/environment/service of the account, each line attributed to its owning service. Live tail: poll the same since-window on an interval and REPLACE your list with each response (the window is honest — see `since`).

Parameters
servicestringquery

Scope to a service by name; spans environments when a project/environment is not also set.

environmentIdstringquery

Scope to a single environment (must belong to projectId when both are given).

projectIdstringquery

Scope the stream to a single project.

filterstringquery

Substring line filter.

limitnumberquery

Max lines (≤1000, default 100).

endstringquery

Absolute window end (ISO). Only meaningful with start; defaults to now.

startstringquery

Absolute window start (ISO). Wins over since; capped to your plan’s retention.

sincestringquery

Relative window, e.g. 1h (capped to your plan’s retention).

accountIdstringpathrequired
Returns
200 · AccountLogsResponseDto
accountIdstringread-only
linesobject[]read-only
truncatedbooleanread-only

True when the line limit was hit before attribution — the RAW fetched count reached the limit (older lines were dropped). Computed BEFORE unattributable lines are filtered, so it never under-reports.

sincestring <date-time>read-only

The RESOLVED absolute window start actually queried — after clamping the relative request to your plan’s retention. Honest: never the raw request string.

cURL
GET /accounts/{accountId}/logs
bash
curl https://api.koo.io/accounts/:accountId/logs \  -H "Authorization: Bearer kc_your_api_token"
Response
json
{  "accountId": "acct_01example0000000000000000x",  "lines": [    {      "ts": "2026-01-01T00:00:00.000Z",      "line": "example",      "project": "example",      "environment": "example",      "service": "example",      "projectId": "project_01example0000000000000000x",      "environmentId": "environment_01example0000000000000000x",      "stream": "stdout",      "replica": "example",      "location": "example",      "container": "example"    }  ],  "truncated": true,  "since": "2026-01-01T00:00:00.000Z"}

On-demand service metrics

GET/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/metrics
Rolesreadereditoradminowner
Parameters
rangestringquery

Relative window, e.g. 1h (capped to your plan’s retention).

metric"cpu" | "mem" | "req" | "latency"queryrequired
namestringpathrequired

Service name within the environment.

environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Returns
200 · MetricsResponseDto
serviceIdstringread-only
metric"cpu" | "mem" | "req" | "latency"read-only
unitstringread-only
rangeobjectread-only

The RESOLVED absolute window actually queried — after clamping the relative request to your plan’s retention.

stepSecnumberread-only
seriesobject[]read-only
cURL
GET /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/services/{name}/metrics
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/services/:name/metrics?metric=example \  -H "Authorization: Bearer kc_your_api_token"
Response
json
{  "serviceId": "svc_01example0000000000000000x",  "metric": "cpu",  "unit": "example",  "range": {    "start": "2026-01-01T00:00:00.000Z",    "end": "2026-01-01T00:00:00.000Z"  },  "stepSec": 1,  "series": [    {      "labels": {        "key": "example"      },      "points": [        {          "t": "2026-01-01T00:00:00.000Z",          "v": 1        }      ]    }  ]}