Skip to documentation
DocumentationAPI referenceGet server metrics
GETBearer token

Get server metrics

/api/v1/servers/:id/metrics

Read stored machine metrics. latest is the most recent report; samples are historical points, with a different shape.

Request example

cURL
curl "https://tovahub.com/api/v1/servers/507f1f77bcf86cd799439012/metrics?period=24hr" \
  -H "Authorization: Bearer $TOVAHUB_TOKEN"

Examples only. No requests are sent from this page.

Illustrative response
JSON
{
  "period": "24hr",
  "serverStatus": "running",
  "metrics": {
    "online": false,
    "reportingMode": 1,
    "reportInterval": 60,
    "lastReportedAt": null,
    "lastSampledAt": null,
    "bootChangedAt": null,
    "shutdownAt": null
  },
  "latest": null,
  "samples": []
}

Parameters

idPath · Required

string

Resource ID: 24 hexadecimal characters. Use the platform ID returned by the matching list endpoint, not a supplier instance ID.

periodQuery · Optional

"1hr" | "24hr" | "7d"

Defaults to 24hr.

Response

HTTP status 200

Read stored host metrics, the latest report, and history samples.

periodstring ('1hr' | '24hr' | '7d')

Requested history period.

serverStatusstring

Normalized saved server status.

metricsobject

Monitoring liveness metadata.

metrics.onlineboolean

Whether recent reports indicate an online agent.

metrics.reportingModenumber

Current configured reporting mode; defaults to one.

metrics.reportIntervalnumber

Expected reporting interval in seconds.

metrics.lastReportedAtstring (ISO 8601) | null

Last report-receipt timestamp.

metrics.lastSampledAtstring (ISO 8601) | null

Last sampled timestamp.

metrics.bootChangedAtstring (ISO 8601) | null

Last detected boot change.

metrics.shutdownAtstring (ISO 8601) | null

Last reported shutdown.

latestobject | null

Most recent stored metrics or shutdown report, or null when no report is available. Its fields differ from history samples.

latest.version1

Report format version.

latest.kind"metrics" | "shutdown"

Report kind.

latest.bootIdstring (UUID)

Identifier of the reported boot.

latest.intervalnumber

Sampling interval in seconds, 5–300.

latest.uptimenumber

Uptime in seconds.

latest.sampledAtnumber (optional)

Client sample timestamp in milliseconds since Unix epoch.

latest.cpunumber | null

CPU usage from 0 to 100 percent, or null when unavailable.

latest.memoryUsednumber

Used memory in bytes.

latest.memoryTotalnumber

Total memory in bytes.

latest.swapUsednumber

Used swap in bytes.

latest.swapTotalnumber

Total swap in bytes.

latest.diskReadnumber | null

Disk read rate in bytes per second.

latest.diskWritenumber | null

Disk write rate in bytes per second.

latest.netInnumber | null

Network receive rate in bytes per second.

latest.netOutnumber | null

Network transmit rate in bytes per second.

latest.disksobject[]

Up to 32 mounted disks with mount (string), total (bytes) and used (bytes).

samplesarray

Up to 600 time-ordered history points. Numeric values are bucket averages; low and high retain per-metric extrema.

samples[].atstring (ISO 8601)

History sample timestamp.

samples[].cpunumber | null

CPU usage percentage, or null when unavailable.

samples[].memoryUsednumber | null

Capacity in bytes, or null when unavailable.

samples[].memoryTotalnumber | null

Capacity in bytes, or null when unavailable.

samples[].swapUsednumber | null

Capacity in bytes, or null when unavailable.

samples[].swapTotalnumber | null

Capacity in bytes, or null when unavailable.

samples[].diskReadnumber | null

Transfer rate in bytes per second, or null when unavailable.

samples[].diskWritenumber | null

Transfer rate in bytes per second, or null when unavailable.

samples[].netInnumber | null

Transfer rate in bytes per second, or null when unavailable.

samples[].netOutnumber | null

Transfer rate in bytes per second, or null when unavailable.

samples[].uptimenumber | null

Uptime in seconds, or null when unavailable.

samples[].disksarray

Mounted disks: {mount: string, used: number, total: number}. Capacities are bytes.

samples[].lowobject

Per-metric minimum values, keyed by the same ten numeric metric names.

samples[].highobject

Per-metric maximum values, keyed by the same ten numeric metric names.