Get a server's metrics

Get the server's CPU, memory, disk space, disk reads and writes, and uptime.

GET https://{availability_zone}.betterstackcloud.com/v1/servers/{id}/metrics
id string required

The ID of the server.

from datetime

The start of the range. Defaults to 24 hours before to. Sending from or to returns a series over time. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

to datetime

The end of the range. Defaults to now. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

Authorization string required

Bearer $TOKEN

200 OK
{
  "server_id": "123456789",
  "server_name": "Example",
  "sampled_at": "2026-07-01T12:00:00.000Z",
  "uptime": {
    "started_at": "2026-07-01T12:00:00.000Z",
    "seconds": 1
  },
  "cpu": {
    "usage_percent": 1.5,
    "vcpus": 1
  },
  "memory": {
    "used_bytes": 1,
    "total_bytes": 1,
    "usage_percent": 1.5
  },
  "disk": {
    "space": {
      "used_bytes": 1,
      "total_bytes": 1,
      "usage_percent": 1.5
    },
    "io": {
      "read_bytes_per_second": 1,
      "write_bytes_per_second": 1
    }
  },
  "cpu_credits": {
    "balance_vcpu_minutes": 1.5,
    "cap_vcpu_minutes": 1.5,
    "baseline_vcpus": 1.5,
    "baseline_percent": 1,
    "capped": false,
    "cap_reason": "example",
    "updated_at": "2026-07-01T12:00:00.000Z"
  },
  "from": "2026-07-01T12:00:00.000Z",
  "to": "2026-07-01T12:00:00.000Z",
  "resolution": "raw",
  "data": [
    {
      "dt": "2026-07-01T12:00:00.000Z",
      "cpu": {
        "usage_percent": 1.5,
        "vcpus": 1
      },
      "memory": {
        "used_bytes": 1,
        "total_bytes": 1,
        "usage_percent": 1.5
      },
      "disk": {
        "space": {
          "used_bytes": 1,
          "total_bytes": 1,
          "usage_percent": 1.5
        },
        "io": {
          "read_bytes_per_second": 1,
          "write_bytes_per_second": 1
        }
      },
      "uptime_seconds": 1,
      "traffic": {
        "bytes_in": 1,
        "bytes_out": 1,
        "bytes_in_intra_az": 1,
        "bytes_out_intra_az": 1
      }
    }
  ]
}

Without from and to, you get a live reading, and the server must be running. Send from or to to get a series over time instead, which works in any status. A range longer than a day has one point per hour.

server_id string

The server's ID, a UUID. Both a live reading and a series have it.

server_name string

The server's name. Both a live reading and a series have it.

sampled_at datetime or null

When we read the values. Only a live reading has it. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

uptime object or null

How long the server has run since it last started. Only a live reading has it.

uptime.started_at datetime or null

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

uptime.seconds integer or null

The seconds.

cpu object or null

CPU use as a percentage of all the server's vCPUs. Only a live reading has it, and each point of a series has its own.

cpu.usage_percent number or null

The usage percent.

cpu.vcpus integer

The vcpus.

memory object or null

The server's memory use. Only a live reading has it, and each point of a series has its own.

memory.used_bytes integer or null

The used bytes.

memory.total_bytes integer

The total bytes.

memory.usage_percent number or null

The usage percent.

disk object or null

The disk space used out of the root disk, and the disk read and write rates. Only a live reading has it, and each point of a series has its own.

disk.space object

The space.

disk.space.used_bytes integer or null

The used bytes.

disk.space.total_bytes integer

The total bytes.

disk.space.usage_percent number or null

The usage percent.

disk.io object

The io.

disk.io.read_bytes_per_second integer or null

The read bytes per second.

disk.io.write_bytes_per_second integer or null

The write bytes per second.

cpu_credits object or null

The CPU credit balance of a shared or spot server. Only a live reading has it. A dedicated server doesn't have it, and neither does a server in a zone without a CPU budget.

cpu_credits.balance_vcpu_minutes number

The balance vcpu minutes.

cpu_credits.cap_vcpu_minutes number

The cap vcpu minutes.

cpu_credits.baseline_vcpus number

The baseline vcpus.

cpu_credits.baseline_percent integer

The baseline percent.

cpu_credits.capped boolean

The capped.

cpu_credits.cap_reason string or null

The cap reason.

cpu_credits.updated_at datetime or null

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

from datetime or null

The start of the range returned. Only a series has it. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

to datetime or null

The end of the range returned. Only a series has it. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

resolution string or null

How far apart the points are. Only a series has it.
Valid values:
raw: One point per minute, for a range of up to one day.
hourly: One point per hour, for a longer range.

data array of objects or null

The points of the series, oldest first. Only a series has it. A minute or hour with no sample has no point. traffic counts the bytes sent and received in each point's interval. For hourly points, the bytes inside the zone, bytes_in_intra_az and bytes_out_intra_az, are null.

data[].dt datetime

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

data[].cpu object

The cpu.

data[].cpu.usage_percent number

The usage percent.

data[].cpu.vcpus integer

The vcpus.

data[].memory object

The memory.

data[].memory.used_bytes integer

The used bytes.

data[].memory.total_bytes integer

The total bytes.

data[].memory.usage_percent number or null

The usage percent.

data[].disk object

The disk.

data[].disk.space object

The space.

data[].disk.space.used_bytes integer

The used bytes.

data[].disk.space.total_bytes integer

The total bytes.

data[].disk.space.usage_percent number or null

The usage percent.

data[].disk.io object

The io.

data[].disk.io.read_bytes_per_second integer

The read bytes per second.

data[].disk.io.write_bytes_per_second integer

The write bytes per second.

data[].uptime_seconds integer

The uptime seconds.

data[].traffic object

The traffic.

data[].traffic.bytes_in integer

The bytes in.

data[].traffic.bytes_out integer

The bytes out.

data[].traffic.bytes_in_intra_az integer or null

The bytes in intra az.

data[].traffic.bytes_out_intra_az integer or null

The bytes out intra az.