Servers

Get Metrics for a Server

Get Metrics for specified Server.

You must specify the type of metric to get: cpu, disk or network. You can also specify more than one type by comma separation, e.g. cpu,disk.

Depending on the type you will get different time series data

TypeTimeseriesUnitDescription
cpucpupercentPercent CPU usage
diskdisk.0.iops.readiop/sNumber of read IO operations per second
disk.0.iops.writeiop/sNumber of write IO operations per second
disk.0.bandwidth.readbytes/sBytes read per second
disk.0.bandwidth.writebytes/sBytes written per second
networknetwork.0.pps.inpackets/sPublic Network interface packets per second received
network.0.pps.outpackets/sPublic Network interface packets per second sent
network.0.bandwidth.inbytes/sPublic Network interface bytes/s received
network.0.bandwidth.outbytes/sPublic Network interface bytes/s sent

Note that the CPU value is not normalized to a fixed 0–100% scale. It is calculated per vCPU: a value of 100 represents full utilization on a 1-vCPU server, and 25% utilization on a 4-vCPU server. To calculate the overall CPU usage, divide the metric value by the number of vCPUs.

Metrics are available for the last 30 days only.

If you do not provide the step argument we will automatically adjust it so that a maximum of 200 samples are returned.

We limit the number of samples returned to a maximum of 500 and will adjust the step parameter accordingly.

get/servers/{id}/metrics

Request

  • Base URL: https://api.hetzner.cloud/v1
  • URL: https://api.hetzner.cloud/v1/servers/{id}/metrics
  • Auth: HTTP bearer

Path parameters

idinteger required

ID of the Server.

Example:42

ID of the Server.

Query parameters

typestring[] required

Type of metrics to get.

startstring required

Start of period to get Metrics for (must be in RFC3339 format).

endstring required

End of period to get Metrics for (must be in RFC3339 format).

stepstring

Resolution of results in seconds.

Response

Request succeeded.

Example response

{
  "metrics": {
    "start": "2017-01-01T00:00:00Z",
    "end": "2017-01-01T23:00:00Z",
    "step": 60,
    "time_series": {
      "name_of_timeseries": {
        "values": [
          [
            1435781470.622,
            "42"
          ],
          [
            1435781471.622,
            "43"
          ]
        ]
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.