Metrics
Every /v1 route for metrics. This page is generated from the API's OpenAPI contract, so it always matches what the API accepts and returns.
Authentication, pagination, errors and idempotency work the same on every route. They are described once, in the API overview.
A project's resource use, per service
GET /v1/projects/{projectId}/usage
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
projectId | string | yes | The project's id. |
Returns
200withV1ProjectUsage.
bash
curl "https://api.naijacloud.com/v1/projects/$PROJECT_ID/usage" \
-H "Authorization: Bearer $NC_API_KEY"A service's resource time series
GET /v1/services/{serviceId}/metrics
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
serviceId | string | yes | The service's id. |
Query parameters
| Name | Type | Required | Notes |
|---|---|---|---|
range | LAST_30_MIN, LAST_HOUR, LAST_6H, LAST_24H, LAST_7D, LAST_30D | no |
Returns
200withV1MetricSeries.
bash
curl "https://api.naijacloud.com/v1/services/$SERVICE_ID/metrics" \
-H "Authorization: Bearer $NC_API_KEY"A service's latest resource sample
GET /v1/services/{serviceId}/usage
Key scopes: READ and PLATFORM_API.
Path parameters
| Name | Type | Required | Notes |
|---|---|---|---|
serviceId | string | yes | The service's id. |
Returns
200withV1ServiceUsage.
bash
curl "https://api.naijacloud.com/v1/services/$SERVICE_ID/usage" \
-H "Authorization: Bearer $NC_API_KEY"Types
V1DatabaseStats
| Field | Type | Notes |
|---|---|---|
cacheHitRatio | number, or null | |
connections | integer, or null | |
engine | WEB, STATIC, CRON, POSTGRES, MYSQL, MARIADB, MONGODB, REDIS, VALKEY | |
itemCount | number, or null | |
itemLabel | string, or null | |
opsPerSec | number, or null | |
opsTotal | number, or null | |
storageBytes | number, or null |
V1MetricPoint
| Field | Type | Notes |
|---|---|---|
blockReadBytesPerSec | number | |
blockWriteBytesPerSec | number | |
cacheHitRatio | number, or null | |
connections | integer, or null | |
cpuPercent | number | |
memoryBytes | number | |
memoryLimitBytes | number | |
memoryPercent | number | |
networkRxBytesPerSec | number | |
networkTxBytesPerSec | number | |
opsPerSec | number, or null | |
storageBytes | number, or null | |
t | string (date-time) |
V1MetricSeries
| Field | Type | Notes |
|---|---|---|
bucketSeconds | integer | |
points | array of V1MetricPoint | |
range | LAST_30_MIN, LAST_HOUR, LAST_6H, LAST_24H, LAST_7D, LAST_30D | |
serviceId | string | |
type | WEB, STATIC, CRON, POSTGRES, MYSQL, MARIADB, MONGODB, REDIS, VALKEY |
V1ProjectUsage
| Field | Type | Notes |
|---|---|---|
avgCpuPercent | number | |
projectId | string | |
serviceCount | integer | |
services | array of V1ServiceUsage | |
totalMemoryBytes | number | |
totalStorageBytes | number |
V1ServiceUsage
| Field | Type | Notes |
|---|---|---|
cpuPercent | number | |
database | V1DatabaseStats, or null | |
hasData | boolean | |
memoryBytes | number | |
memoryLimitBytes | number | |
memoryPercent | number | |
networkRxBytesPerSec | number | |
networkTxBytesPerSec | number | |
sampledAt | string (date-time), or null | |
serviceId | string | |
type | WEB, STATIC, CRON, POSTGRES, MYSQL, MARIADB, MONGODB, REDIS, VALKEY |