Skip to content
API reference2f737e9 · docs(api): logs

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

A 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:

Shell
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

GET/v1/organizations/{org}/projects/{project}/applications/{cube}/builds/{build-id}/logs
Read-only key

Streams 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

NameTypeDescription
orgrequiredstring

The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with 403, and so is a slug that matches no organization. An ID that matches no organization at all is 404.

projectrequiredstring

The ID or slug of the project. A slug is unique within the organization.

cuberequiredstring

The ID or slug of the cube. A slug is unique within the project.

build-idrequiredstring

The ID of the build: the id you got when you started it. An opaque string that starts with bld_ (dep_ for the oldest builds). A build of another cube is not found.

Query parameters

NameTypeDescription
followboolean

true keeps the stream open: it sends new lines a few seconds after they are printed. Without it, or with false, the stream sends the lines that exist and ends.

cursorstring

Where to continue a stream: the id of the last event you received, as it is. Send it after a broken connection, and the stream goes on after that line. A value that is not a log position, or whose position has expired, is refused with 400; the message differs between the two, so match on the code. Leave it out to start at the beginning.

Header parameters

NameTypeDescription
Last-Event-IDstring

The same as cursor: the id of the last event you received. EventSource sends it by itself when it reconnects. If both are sent, this one counts.

Responses

StatusDescription
200

The log lines, as a stream of Server-Sent Events.

400

The request is not valid. error.field names the field to blame, when there is one.

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 404, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is 403, not 404.

429

The key made too many requests. Wait for the number of seconds in Retry-After, then retry.

500

Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the error.requestId.

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

Shell
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/builds/<build-id>/logs" \
  -H "Authorization: Bearer $CUBECEN_API_KEY"
Response
"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"

Stream the logs of a deployment

GET/v1/organizations/{org}/projects/{project}/applications/{cube}/deployments/{deployment-id}/logs
Read-only key

Streams 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

NameTypeDescription
orgrequiredstring

The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with 403, and so is a slug that matches no organization. An ID that matches no organization at all is 404.

projectrequiredstring

The ID or slug of the project. A slug is unique within the organization.

cuberequiredstring

The ID or slug of the cube. A slug is unique within the project.

deployment-idrequiredstring

The ID of the deployment: the id that createDeployment gave, or that listDeployments shows. An opaque string that starts with dpl_. A deployment of another cube is not found.

Query parameters

NameTypeDescription
followboolean

true keeps the stream open: it sends new lines a few seconds after they are printed. Without it, or with false, the stream sends the lines that exist and ends.

cursorstring

Where to continue a stream: the id of the last event you received, as it is. Send it after a broken connection, and the stream goes on after that line. A value that is not a log position, or whose position has expired, is refused with 400; the message differs between the two, so match on the code. Leave it out to start at the beginning.

Header parameters

NameTypeDescription
Last-Event-IDstring

The same as cursor: the id of the last event you received. EventSource sends it by itself when it reconnects. If both are sent, this one counts.

Responses

StatusDescription
200

The log lines, as a stream of Server-Sent Events.

400

The request is not valid. error.field names the field to blame, when there is one.

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 404, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is 403, not 404.

429

The key made too many requests. Wait for the number of seconds in Retry-After, then retry.

500

Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the error.requestId.

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

Shell
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/deployments/<deployment-id>/logs" \
  -H "Authorization: Bearer $CUBECEN_API_KEY"
Response
"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"

Stream the logs of a cube

GET/v1/organizations/{org}/projects/{project}/applications/{cube}/logs
Read-only key

Streams 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

NameTypeDescription
orgrequiredstring

The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with 403, and so is a slug that matches no organization. An ID that matches no organization at all is 404.

projectrequiredstring

The ID or slug of the project. A slug is unique within the organization.

cuberequiredstring

The ID or slug of the cube. A slug is unique within the project.

Query parameters

NameTypeDescription
followboolean

true keeps the stream open: it sends new lines a few seconds after they are printed. Without it, or with false, the stream sends the lines that exist and ends.

cursorstring

Where to continue a stream: the id of the last event you received, as it is. Send it after a broken connection, and the stream goes on after that line. A value that is not a log position, or whose position has expired, is refused with 400; the message differs between the two, so match on the code. Leave it out to start at the beginning.

tailinteger

Start with the last N lines, from 1 to 1000. Without tail, since or a cursor, the last 100 lines. Not together with since.

sincestring

Start at this time, as an RFC 3339 time, instead of with the last lines. Not together with tail.

Header parameters

NameTypeDescription
Last-Event-IDstring

The same as cursor: the id of the last event you received. EventSource sends it by itself when it reconnects. If both are sent, this one counts.

Responses

StatusDescription
200

The log lines, as a stream of Server-Sent Events.

400

The request is not valid. error.field names the field to blame, when there is one.

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 404, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is 403, not 404.

429

The key made too many requests. Wait for the number of seconds in Retry-After, then retry.

500

Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the error.requestId.

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

Shell
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/logs" \
  -H "Authorization: Bearer $CUBECEN_API_KEY"
Response
"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"

Get the metrics of a cube

GET/v1/organizations/{org}/projects/{project}/applications/{cube}/metrics
Read-only key

Returns 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

NameTypeDescription
orgrequiredstring

The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with 403, and so is a slug that matches no organization. An ID that matches no organization at all is 404.

projectrequiredstring

The ID or slug of the project. A slug is unique within the organization.

cuberequiredstring

The ID or slug of the cube. A slug is unique within the project.

Query parameters

NameTypeDescription
rangestring

The window, ending now: 1h (the default), 6h, 24h, 7d or 30d. Not together with from or to.

fromstring

The start of the window, as an RFC 3339 time. Without it, one hour before to. At most 30 days before to.

tostring

The end of the window, as an RFC 3339 time. Without it, now. A time in the future counts as now.

stepinteger

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

StatusDescription
200

The metrics of the cube over the window.

Metrics object11 fields
fromstringrequired

The start of the window, rounded down to a multiple of step.

tostringrequired

The end of the window, rounded down to a multiple of step.

stepintegerrequired

The seconds between points.

cpuobjectrequired

The CPU in use, in cores.

cpu object4 fields
unitstringrequired

The unit of the points: cores or bytes.

totalarray of array of numberrequired

The use of all replicas together.

limitarray of array of numberrequired

The sum of the limits of the running replicas.

podsarray of objectrequired

The use of each replica.

pods items2 fields
podstringrequired

The replica's name. A new name is a new replica, or the pod of a new deployment.

pointsarray of array of numberrequired

The use of this replica.

memoryobjectrequired

The memory in use, in bytes.

memory object4 fields
unitstringrequired

The unit of the points: cores or bytes.

totalarray of array of numberrequired

The use of all replicas together.

limitarray of array of numberrequired

The sum of the limits of the running replicas.

podsarray of objectrequired

The use of each replica.

pods items2 fields
podstringrequired

The replica's name. A new name is a new replica, or the pod of a new deployment.

pointsarray of array of numberrequired

The use of this replica.

networkobjectrequired

The network traffic of all replicas together.

network object3 fields
unitstringrequired

The unit of the points: bytes/s.

receivearray of array of numberrequired

The bytes per second received.

transmitarray of array of numberrequired

The bytes per second sent.

requestsobjectrequired

The requests per second that reach the cube, in total and by status class.

requests object7 fields
unitstringrequired

The unit of the points: requests/s.

totalarray of array of numberrequired

All requests.

1xxarray of array of numberrequired

Requests answered with a 1xx status.

2xxarray of array of numberrequired

Requests answered with a 2xx status.

3xxarray of array of numberrequired

Requests answered with a 3xx status.

4xxarray of array of numberrequired

Requests answered with a 4xx status.

5xxarray of array of numberrequired

Requests answered with a 5xx status.

error_rateobjectrequired

The share of requests that were answered with a 5xx status. There is a gap where there were no requests.

error_rate object2 fields
unitstringrequired

The unit of the points: ratio, from 0 to 1.

pointsarray of array of numberrequired

The share of failed requests in each step.

latencyobjectrequired

How 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 fields
unitstringrequired

The unit of the points: seconds.

p50array of array of numberrequired

The median time of a request.

p95array of array of numberrequired

The time that 95 percent of requests stayed within.

p99array of array of numberrequired

The time that 99 percent of requests stayed within.

restartsobjectrequired

The container restarts in each step. Their sum is the total.

restarts object2 fields
unitstringrequired

The unit of the points: count.

pointsarray of array of numberrequired

The restarts in each step.

replicasobjectrequired

The replicas of the cube.

replicas object3 fields
unitstringrequired

The unit of the points: count.

readyarray of array of numberrequired

The replicas that are ready.

desiredarray of array of numberrequired

The replicas that the cube is meant to have.

400

The request is not valid. error.field names the field to blame, when there is one.

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 404, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is 403, not 404.

429

The key made too many requests. Wait for the number of seconds in Retry-After, then retry.

500

Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the error.requestId.

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

Shell
curl -sS "https://api.cubecen.com/v1/organizations/<org>/projects/<project>/applications/<cube>/metrics" \
  -H "Authorization: Bearer $CUBECEN_API_KEY"
Response
{
  "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
      ]
    ]
  }
}