Read a service's metrics
CPU, memory, network and restarts of each of its replicas over the range, from the samples its servers' agents report every few seconds. Anyone who can see the service may read them.
bearerAuthorizationBearer <token>An API key (opk_…) or a CLI token (opc_…).
serviceId*stringThe service's id.
range?stringHow far back: 1h, 6h, 24h, 7d or 30d. Default 1h.
"1h""6h""24h""7d""30d"Read a service's metrics
application/json- response
serviceId*stringuuidrange*string"1h""6h""24h""7d""30d"step*integerSeconds between points.
start*stringdate-timeend*stringdate-timecpu*Percent of one CPU core.
memory*Bytes in use.
networkRx*Bytes received per second.
networkTx*Bytes sent per second.
restarts*Each container's restart counter.
curl "https://openpanel.sh/api/v1/services/$SERVICE_ID/metrics" \ -H "Authorization: Bearer $OPENPANEL_TOKEN"{ "serviceId": "8f8bb40f-b96b-40fe-9064-5031fbe483f9", "range": "1h", "step": 0, "start": "2019-08-24T14:15:22Z", "end": "2019-08-24T14:15:22Z", "cpu": { "unit": "string", "series": [ { "replica": 0, "container": "string", "serverId": "string", "deploymentId": "string", "points": [ [ 0, 0 ] ] } ] }, "memory": { "unit": "string", "series": [ { "replica": 0, "container": "string", "serverId": "string", "deploymentId": "string", "points": [ [ 0, 0 ] ] } ] }, "networkRx": { "unit": "string", "series": [ { "replica": 0, "container": "string", "serverId": "string", "deploymentId": "string", "points": [ [ 0, 0 ] ] } ] }, "networkTx": { "unit": "string", "series": [ { "replica": 0, "container": "string", "serverId": "string", "deploymentId": "string", "points": [ [ 0, 0 ] ] } ] }, "restarts": { "unit": "string", "series": [ { "replica": 0, "container": "string", "serverId": "string", "deploymentId": "string", "points": [ [ 0, 0 ] ] } ], "total": 0 }}Read a service's logs GET
The newest lines its running containers wrote, read live from each server through its agent and merged by time. Logs stay on the servers, so a server whose agent is away is listed in unreachable instead.
List variables in a scope GET
The variables set on the whole project, or on one environment or one service when its id is given. Secrets come without their value.