Skip to content
DocsOpenAPI spec

    List VM's Metrics

    GET/v1/compute/vms/{vm_id}/metrics

    Read a VM’s resource metrics over an interval. Every series covers the same periods, so they line up index for index, and a period the VM reported no observation for carries a null value.

    Path ParametersExpand Collapse
    vm_id: string
    Query ParametersExpand Collapse
    aggregation: optional "mean" or "max" or "min"

    How the samples inside one period are folded into a single value.

    One of the following:
    "mean"
    "max"
    "min"
    end_time: optional string

    End of the interval, exclusive, as an RFC 3339 timestamp. Defaults to now.

    formatdate-time
    metric: optional array of "compute.nirvanalabs.io/vm/cpu/used_cores" or "compute.nirvanalabs.io/vm/cpu/utilization" or "compute.nirvanalabs.io/vm/memory/used_bytes" or 7 more

    Metric to return. Repeat the parameter for several; every metric is returned when it is left out.

    One of the following:
    "compute.nirvanalabs.io/vm/cpu/used_cores"
    "compute.nirvanalabs.io/vm/cpu/utilization"
    "compute.nirvanalabs.io/vm/memory/used_bytes"
    "compute.nirvanalabs.io/vm/memory/utilization"
    "compute.nirvanalabs.io/vm/disk/read_bytes"
    "compute.nirvanalabs.io/vm/disk/write_bytes"
    "compute.nirvanalabs.io/vm/disk/read_ops"
    "compute.nirvanalabs.io/vm/disk/write_ops"
    "compute.nirvanalabs.io/vm/network/rx_bytes"
    "compute.nirvanalabs.io/vm/network/tx_bytes"
    period: optional "5m" or "15m" or "1h" or 2 more

    Width of one period, and so the spacing between points. An interval holding more than 1440 periods is rejected; the error names a period that fits.

    One of the following:
    "5m"
    "15m"
    "1h"
    "6h"
    "24h"
    start_time: optional string

    Start of the interval, inclusive, as an RFC 3339 timestamp. Defaults to an hour before end_time. A start older than the 30 days of history kept is served from where that history begins.

    formatdate-time
    ReturnsExpand Collapse
    VMMetrics object { aggregation, end_time, metrics, 3 more }

    A VM’s metrics over an interval: one series per metric, on a shared grid of periods.

    aggregation: "mean" or "max" or "min"

    How the samples inside one period were folded into a single value.

    One of the following:
    "mean"
    "max"
    "min"
    end_time: string

    End of the interval served, exclusive.

    formatdate-time
    metrics: array of VMMetricSeries { metric, points, unit }

    One series per requested metric, in the order they were requested.

    metric: string

    Fully-qualified name of the metric.

    points: array of VMMetricPoint { timestamp, value }

    Values over the interval, oldest first. Every series in a response covers the same periods, so they line up index for index.

    timestamp: string

    End of the period the value covers, so a point timestamped 00:05 over five-minute periods describes 00:00 through 00:05.

    formatdate-time
    value: number

    Value over the period, in the series’ unit. Null means the VM reported no observation for this period, which is what a stopped VM looks like.

    Unit the values are expressed in.

    One of the following:
    "ratio"
    "bytes"
    "cores"
    "bytes_per_second"
    "operations_per_second"
    period: "5m" or "15m" or "1h" or 2 more

    Width of one period, and so the spacing between consecutive points.

    One of the following:
    "5m"
    "15m"
    "1h"
    "6h"
    "24h"
    start_time: string

    Start of the interval served, inclusive. It can be later than the requested start when the request asked for more than the available history.

    formatdate-time
    vm_id: string

    ID of the VM the series belong to.

    List VM's Metrics

    curl https://api.nirvanalabs.io/v1/compute/vms/$VM_ID/metrics \
        -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"
    {
      "aggregation": "mean",
      "end_time": "2026-01-01T01:00:00Z",
      "metrics": [
        {
          "metric": "compute.nirvanalabs.io/vm/cpu/utilization",
          "points": [
            {
              "timestamp": "2026-01-01T00:05:00Z",
              "value": 0.42
            }
          ],
          "unit": "ratio"
        }
      ],
      "period": "5m",
      "start_time": "2026-01-01T00:00:00Z",
      "vm_id": "123e4567-e89b-12d3-a456-426614174000"
    }
    Returns Examples
    {
      "aggregation": "mean",
      "end_time": "2026-01-01T01:00:00Z",
      "metrics": [
        {
          "metric": "compute.nirvanalabs.io/vm/cpu/utilization",
          "points": [
            {
              "timestamp": "2026-01-01T00:05:00Z",
              "value": 0.42
            }
          ],
          "unit": "ratio"
        }
      ],
      "period": "5m",
      "start_time": "2026-01-01T00:00:00Z",
      "vm_id": "123e4567-e89b-12d3-a456-426614174000"
    }