Get a Valkey instance's metrics

Get the metrics of each member over time, such as memory, clients, operations and hit ratio. Defaults to the last day. A range can be up to 366 days long.

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

The ID of the Valkey instance.

from datetime

The start of the range, included. Defaults to one day before to. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

to datetime

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

Authorization string required

Bearer $TOKEN

200 OK
{
  "valkey_id": "123456789",
  "valkey_name": "Example",
  "from": "2026-07-01T12:00:00.000Z",
  "to": "2026-07-01T12:00:00.000Z",
  "resolution": "raw",
  "members": [
    {
      "member_id": "123456789",
      "role": "example",
      "data": [
        {
          "dt": "2026-07-01T12:00:00.000Z",
          "memory": {
            "used_bytes": 1,
            "used_bytes_max": 1,
            "usable_bytes": 1
          },
          "clients": {
            "connected": 1.5,
            "connected_max": 1
          },
          "operations_per_second": 1.5,
          "hit_ratio": 1.5,
          "evicted_keys_per_second": 1.5,
          "expired_keys_per_second": 1.5,
          "replication_lag_bytes": 1
        }
      ]
    }
  ]
}

Returns the metrics as one object.

valkey_id string

The instance's ID, a UUID.

valkey_name string

The instance's name.

from datetime

The start of the range, included. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

to datetime

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

resolution string

How far apart the points are.
Valid values:
raw: One point a minute, for a range up to one day.
hourly: One point an hour, for a longer range.

members array of objects

The metrics of each member.

members[].member_id string

The member's ID.

members[].role string

The member's role, primary or replica.

members[].data array of objects

The member's metrics, one entry per point.

members[].data[].dt datetime

The start of the minute or hour the point covers. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

members[].data[].memory object

Memory use.

members[].data[].memory.used_bytes integer

The average memory used, in bytes.

members[].data[].memory.used_bytes_max integer

The most memory used, in bytes.

members[].data[].memory.usable_bytes integer

The plan's memory for your data, in bytes.

members[].data[].clients object

Connected clients.

members[].data[].clients.connected number

The average number of connected clients.

members[].data[].clients.connected_max integer

The most connected clients.

members[].data[].operations_per_second number

Commands per second.

members[].data[].hit_ratio number

The share of key lookups that found the key, from 0 to 1.

members[].data[].evicted_keys_per_second number

Keys evicted per second.

members[].data[].expired_keys_per_second number

Keys expired per second.

members[].data[].replication_lag_bytes integer

How far a replica is behind the primary, in bytes.