Logs and metrics
These endpoints show what a cube prints and how it is doing. They give the logs of a build, of a deployment and of a running cube, and the metrics of a cube. They only read, so a read-only key can call them.
Endpoints
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ builds/ {build-id}/ logsGETStream the logs of a deployment/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ deployments/ {deployment-id}/ logsGETStream the logs of a cube/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ logsGETGet the metrics of a cube/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ metricsA log is a stream of Server-Sent Events: text that arrives line by line while the connection is open. Send the key in the Authorization header. A browser's EventSource can't, so in a browser read the stream with fetch. Without follow, the stream sends the lines that exist and ends. With follow=true it stays open and sends new lines a few seconds after they are printed. Each event has an id. After a broken connection, send the id of the last event you got as cursor to continue. The API also ends a stream opened with follow=true after about ten minutes: open it again the same way.
When a build or a deployment fails, its logs say why. Follow one while it runs:
curl -sS -N "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/builds/<build-id>/logs?follow=true" \
-H "Authorization: Bearer $CUBECEN_API_KEY"Build and deployment logs are kept for 30 days. A cube's own output is kept for as many days as logs_retention_days in its organization's plan. What a cube prints is not hidden, secrets included, so don't print secrets. The line of an event is untrusted text: show it as text, never as HTML.
Metrics answer with CPU, memory, network, requests, failed requests, latency, restarts and replicas over a window. The window is a range such as 24h, or a from and a to. Every series is a list of [unix seconds, value] points. A missing point is a gap, not zero. An answer is kept for 30 seconds, so refresh a chart no more often than that.
When logs or metrics can't be read for a moment, the answer is 503: LOGS_UNAVAILABLE or METRICS_UNAVAILABLE. See Errors.
Stream the logs of a build
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ builds/ {build-id}/ logsStreams the log lines of one build, from fetching the source to pushing the image, as Server-Sent Events (text/event-stream). Use it to see why a build failed, or to follow a build that is running. It needs only read access.
Without follow, the stream sends the lines that exist and ends with an end event. With follow=true it stays open and sends new lines a few seconds after they are printed. When the build has finished and every line is sent, the stream ends with complete: true.
To continue after a broken connection, send the id of the last event you received as cursor. tail and since are for the output of a running cube (getApplicationLogs): without a cursor, a request that has one of them is refused with 400.
Build logs are kept for 30 days. A build of another cube is not found. The events are described under the response.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
build-idrequired | string | The ID of the build: the |
Query parameters
| Name | Type | Description |
|---|---|---|
follow | boolean |
|
cursor | string | Where to continue a stream: the |
Header parameters
| Name | Type | Description |
|---|---|---|
Last-Event-ID | string | The same as |
Responses
| Status | Description |
|---|---|
| 200 | The log lines, as a stream of Server-Sent Events. |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/builds/<build-id>/logs" \
-H "Authorization: Bearer $CUBECEN_API_KEY""retry: 3000\n: connected\n\nid: Mzc4MQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:12:44.120483Z\",\"source\":\"build\",\"step\":\"fetch\",\"line\":\"Fetching revision main\"}\n\nid: Mzc4Mg\nevent: log\ndata: {\"time\":\"2026-10-25T09:12:51.903112Z\",\"source\":\"build\",\"step\":\"build\",\"line\":\"#5 [2/4] RUN npm ci\"}\n\nid: Mzc4Mw\nevent: end\ndata: {\"complete\":true,\"cursor\":\"Mzc4Mw\"}\n"{
"error": {
"code": "VALIDATION_ERROR",
"message": "follow must be true or false",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
"field": "follow"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "LOGS_UNAVAILABLE",
"message": "Logs are temporarily unavailable; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Stream the logs of a deployment
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ deployments/ {deployment-id}/ logsStreams the log lines of one deployment as Server-Sent Events (text/event-stream): its own steps (apply and rollout), the output of the new pods as they start, and the pod events that happen while it rolls out, such as a restart. Use it to see why a deployment failed, or to follow one that is going on. It needs only read access.
Without follow, the stream sends the lines that exist and ends with an end event. With follow=true it stays open and sends new lines a few seconds after they are printed. When the deployment has finished and every line is sent, the stream ends with complete: true.
To continue after a broken connection, send the id of the last event you received as cursor. tail and since are for the output of a running cube (getApplicationLogs): without a cursor, a request that has one of them is refused with 400.
Deployment logs are kept for 30 days. A deployment of another cube is not found. The events are described under the response.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
deployment-idrequired | string | The ID of the deployment: the |
Query parameters
| Name | Type | Description |
|---|---|---|
follow | boolean |
|
cursor | string | Where to continue a stream: the |
Header parameters
| Name | Type | Description |
|---|---|---|
Last-Event-ID | string | The same as |
Responses
| Status | Description |
|---|---|
| 200 | The log lines, as a stream of Server-Sent Events. |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/deployments/<deployment-id>/logs" \
-H "Authorization: Bearer $CUBECEN_API_KEY""retry: 3000\n: connected\n\nid: NDEwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:14:04.511903Z\",\"source\":\"deploy\",\"step\":\"apply\",\"line\":\"Applying the new version\"}\n\nid: NDEwMg\nevent: log\ndata: {\"time\":\"2026-10-25T09:14:19.340771Z\",\"source\":\"event\",\"reason\":\"Pulled\",\"event_type\":\"Normal\",\"object\":\"Pod/app-4c1d9e07-7784d7c787-fk4jm\",\"line\":\"Successfully pulled image\"}\n\nid: NDEwMw\nevent: end\ndata: {\"complete\":true,\"cursor\":\"NDEwMw\"}\n"{
"error": {
"code": "VALIDATION_ERROR",
"message": "follow must be true or false",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
"field": "follow"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "LOGS_UNAVAILABLE",
"message": "Logs are temporarily unavailable; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Stream the logs of a cube
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ logsStreams what a running cube prints, from all of its replicas, together with its pod events, as Server-Sent Events (text/event-stream). Use it to see what a cube prints now, or what it printed a little while ago. It needs only read access.
The stream starts with a window of the output: the last tail lines (1 to 1000), or the lines since since, or the last 100 lines when you send neither. tail and since together are refused with 400. Without follow, the stream ends with an end event after the window. With follow=true it stays open and sends new lines a few seconds after they are printed.
To continue after a broken connection, send the id of the last event you received as cursor. It wins over tail and since.
Lines are shown as the cube printed them. What a cube prints is not hidden, secrets included, so do not print secrets. A cube's output is kept for logs_retention_days days (see getOrganizationPlan). A cube that is not set up yet, for example while it is being created, has no logs and is answered with 404. The events are described under the response.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
Query parameters
| Name | Type | Description |
|---|---|---|
follow | boolean |
|
cursor | string | Where to continue a stream: the |
tail | integer | Start with the last N lines, from 1 to 1000. Without |
since | string | Start at this time, as an RFC 3339 time, instead of with the last lines. Not together with |
Header parameters
| Name | Type | Description |
|---|---|---|
Last-Event-ID | string | The same as |
Responses
| Status | Description |
|---|---|
| 200 | The log lines, as a stream of Server-Sent Events. |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/logs" \
-H "Authorization: Bearer $CUBECEN_API_KEY""retry: 3000\n: connected\n\nid: NTIwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:20:01.204118Z\",\"source\":\"runtime\",\"pod\":\"app-4c1d9e07-7784d7c787-fk4jm\",\"line\":\"Listening on port 8080\"}\n\nid: NTIwMg\nevent: log\ndata: {\"time\":\"2026-10-25T09:20:09.774002Z\",\"source\":\"runtime\",\"pod\":\"app-4c1d9e07-7784d7c787-fk4jm\",\"line\":\"GET /health 200 2ms\"}\n\n: ping\n"{
"error": {
"code": "VALIDATION_ERROR",
"message": "follow must be true or false",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
"field": "follow"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "LOGS_UNAVAILABLE",
"message": "Logs are temporarily unavailable; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Get the metrics of a cube
/ v1/ organizations/ {org}/ projects/ {project}/ applications/ {cube}/ metricsReturns the resource use, traffic and health of a cube over a window of time, ready for charts: CPU, memory, network, requests by status class, the share of failed requests, latency, restarts and replicas. It needs only read access.
The window is range (1h by default, 6h, 24h, 7d or 30d, ending now), or from and to, at most 30 days apart. Do not send range together with from or to. step is the number of seconds between points, from 30 to 86400, with at most 1000 points. Without step, it is the smallest multiple of 30 seconds that gives at most 240 points. from and to are rounded down to a multiple of the step, so the same window always gives the same points.
Every series is a list of points, [unix seconds, value], oldest first. A missing point is a gap, for example while the cube was not running or got no requests: draw it as a gap, not as zero. A series without points is [].
Samples appear 30 to 60 seconds after the fact, so the newest point can be missing. An answer is kept for 30 seconds: refresh an open chart at most every 30 seconds, and every few minutes for ranges over a day. Metrics are kept for metrics_retention_days days (see getOrganizationPlan).
A cube that is not set up yet, for example while it is being created, has no metrics and is answered with 404. When metrics cannot be read for a moment, the answer is 503 METRICS_UNAVAILABLE with Retry-After: retry with backoff.
Path parameters
| Name | Type | Description |
|---|---|---|
orgrequired | string | The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with |
projectrequired | string | The ID or slug of the project. A slug is unique within the organization. |
cuberequired | string | The ID or slug of the cube. A slug is unique within the project. |
Query parameters
| Name | Type | Description |
|---|---|---|
range | string | The window, ending now: |
from | string | The start of the window, as an RFC 3339 time. Without it, one hour before |
to | string | The end of the window, as an RFC 3339 time. Without it, now. A time in the future counts as now. |
step | integer | The seconds between points, from 30 to 86400. The window can have at most 1000 points. Without it, the smallest multiple of 30 that gives at most 240 points. |
Responses
| Status | Description |
|---|---|
| 200 | The metrics of the cube over the window. Metrics object11 fieldsfromstringrequiredThe start of the window, rounded down to a multiple of tostringrequiredThe end of the window, rounded down to a multiple of stepintegerrequiredThe seconds between points. cpuobjectrequiredThe CPU in use, in cores. cpu object4 fieldsunitstringrequiredThe unit of the points: totalarray of array of numberrequiredThe use of all replicas together. limitarray of array of numberrequiredThe sum of the limits of the running replicas. podsarray of objectrequiredThe use of each replica. pods items2 fieldspodstringrequiredThe replica's name. A new name is a new replica, or the pod of a new deployment. pointsarray of array of numberrequiredThe use of this replica. memoryobjectrequiredThe memory in use, in bytes. memory object4 fieldsunitstringrequiredThe unit of the points: totalarray of array of numberrequiredThe use of all replicas together. limitarray of array of numberrequiredThe sum of the limits of the running replicas. podsarray of objectrequiredThe use of each replica. pods items2 fieldspodstringrequiredThe replica's name. A new name is a new replica, or the pod of a new deployment. pointsarray of array of numberrequiredThe use of this replica. networkobjectrequiredThe network traffic of all replicas together. network object3 fieldsunitstringrequiredThe unit of the points: receivearray of array of numberrequiredThe bytes per second received. transmitarray of array of numberrequiredThe bytes per second sent. requestsobjectrequiredThe requests per second that reach the cube, in total and by status class. requests object7 fieldsunitstringrequiredThe unit of the points: totalarray of array of numberrequiredAll requests. 1xxarray of array of numberrequiredRequests answered with a 1xx status. 2xxarray of array of numberrequiredRequests answered with a 2xx status. 3xxarray of array of numberrequiredRequests answered with a 3xx status. 4xxarray of array of numberrequiredRequests answered with a 4xx status. 5xxarray of array of numberrequiredRequests answered with a 5xx status. error_rateobjectrequiredThe share of requests that were answered with a 5xx status. There is a gap where there were no requests. error_rate object2 fieldsunitstringrequiredThe unit of the points: pointsarray of array of numberrequiredThe share of failed requests in each step. latencyobjectrequiredHow long requests took, measured where they enter Cubecen, so it adds a short hop to the cube's own response time. Values are estimates from buckets of 5 ms to 10 s, and anything above 10 s shows as 10 s. latency object4 fieldsunitstringrequiredThe unit of the points: p50array of array of numberrequiredThe median time of a request. p95array of array of numberrequiredThe time that 95 percent of requests stayed within. p99array of array of numberrequiredThe time that 99 percent of requests stayed within. restartsobjectrequiredThe container restarts in each step. Their sum is the total. restarts object2 fieldsunitstringrequiredThe unit of the points: pointsarray of array of numberrequiredThe restarts in each step. replicasobjectrequiredThe replicas of the cube. replicas object3 fieldsunitstringrequiredThe unit of the points: readyarray of array of numberrequiredThe replicas that are ready. desiredarray of array of numberrequiredThe replicas that the cube is meant to have. |
| 400 | The request is not valid. |
| 401 | The API key is missing, unknown, expired or revoked. |
| 403 | The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's. |
| 404 | Nothing was found at this address. An organization ID that matches no organization is |
| 429 | The key made too many requests. Wait for the number of seconds in |
| 500 | Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the |
| 503 | The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown. |
Example
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/metrics" \
-H "Authorization: Bearer $CUBECEN_API_KEY"{
"from": "2026-10-25T09:00:00Z",
"to": "2026-10-25T09:01:00Z",
"step": 30,
"cpu": {
"unit": "cores",
"total": [
[
1792918800,
0.012
],
[
1792918830,
0.015
],
[
1792918860,
0.011
]
],
"limit": [
[
1792918800,
0.5
],
[
1792918830,
0.5
],
[
1792918860,
0.5
]
],
"pods": [
{
"pod": "app-4c1d9e07-7784d7c787-fk4jm",
"points": [
[
1792918800,
0.012
],
[
1792918830,
0.015
],
[
1792918860,
0.011
]
]
}
]
},
"memory": {
"unit": "bytes",
"total": [
[
1792918800,
52428800
],
[
1792918830,
52953088
],
[
1792918860,
52953088
]
],
"limit": [
[
1792918800,
2147483648
],
[
1792918830,
2147483648
],
[
1792918860,
2147483648
]
],
"pods": [
{
"pod": "app-4c1d9e07-7784d7c787-fk4jm",
"points": [
[
1792918800,
52428800
],
[
1792918830,
52953088
],
[
1792918860,
52953088
]
]
}
]
},
"network": {
"unit": "bytes/s",
"receive": [
[
1792918800,
1840.5
],
[
1792918830,
2210.2
],
[
1792918860,
1795.8
]
],
"transmit": [
[
1792918800,
9120.4
],
[
1792918830,
10480.9
],
[
1792918860,
8870.1
]
]
},
"requests": {
"unit": "requests/s",
"total": [
[
1792918800,
3.2
],
[
1792918830,
3.9
],
[
1792918860,
3.1
]
],
"1xx": [],
"2xx": [
[
1792918800,
3.1
],
[
1792918830,
3.8
],
[
1792918860,
3.1
]
],
"3xx": [],
"4xx": [
[
1792918800,
0.1
],
[
1792918830,
0.1
]
],
"5xx": []
},
"error_rate": {
"unit": "ratio",
"points": [
[
1792918800,
0
],
[
1792918830,
0
],
[
1792918860,
0
]
]
},
"latency": {
"unit": "seconds",
"p50": [
[
1792918800,
0.012
],
[
1792918830,
0.011
],
[
1792918860,
0.012
]
],
"p95": [
[
1792918800,
0.045
],
[
1792918830,
0.048
],
[
1792918860,
0.044
]
],
"p99": [
[
1792918800,
0.09
],
[
1792918830,
0.12
],
[
1792918860,
0.08
]
]
},
"restarts": {
"unit": "count",
"points": [
[
1792918800,
0
],
[
1792918830,
0
],
[
1792918860,
0
]
]
},
"replicas": {
"unit": "count",
"ready": [
[
1792918800,
1
],
[
1792918830,
1
],
[
1792918860,
1
]
],
"desired": [
[
1792918800,
1
],
[
1792918830,
1
],
[
1792918860,
1
]
]
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "range must be 1h, 6h, 24h, 7d or 30d",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
"field": "range"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication required",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests with this API key; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"error": {
"code": "METRICS_UNAVAILABLE",
"message": "Metrics are temporarily unavailable; try again shortly",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}