# OBSERVE

> Return a summary of the server's state, or its key operational metrics, as RESP.

URL: https://docs.hotkv.com/commands/observe/

```
OBSERVE INFO
OBSERVE METRICS
```

- Group: Observability
- Complexity: O(1)
- HotKV Cloud: Performance and Scale plans
- On-Premise: requires the enterprise-observability license feature

`OBSERVE` gives monitoring tools a short, fixed set of figures over the
normal client connection, for when you cannot scrape the Prometheus
endpoint (`metrics-port`). For everything, use [INFO](https://docs.hotkv.com/commands/info/index.md).

## Subcommands

| Subcommand | Fields |
| --- | --- |
| `INFO` | `uptime_seconds`, `connected_clients`, `total_commands`, `used_memory_bytes`, `peak_memory_bytes`, `total_connections`, `enterprise_features` |
| `METRICS` | `uptime_seconds`, `connected_clients`, `total_commands`, `total_connections`, `used_memory_bytes`, `peak_memory_bytes`, `slowlog_length`, `alerts_sent`, `alerts_failed`, `num_workers` |

| Field | Meaning |
| --- | --- |
| `uptime_seconds` | Seconds since the server started |
| `connected_clients` | Clients connected now |
| `total_commands` | Commands processed since start |
| `total_connections` | Connections accepted since start |
| `used_memory_bytes`, `peak_memory_bytes` | Memory in use now, and the highest so far |
| `enterprise_features` | The features the license enables (as [LICENSE.INFO](https://docs.hotkv.com/commands/license-info/index.md) lists them), or `(no valid license)` |
| `slowlog_length` | Entries in the slow log |
| `alerts_sent`, `alerts_failed` | Webhook alerts delivered and failed (see [ALERTS](https://docs.hotkv.com/commands/alerts/index.md)) |
| `num_workers` | Threads serving client connections |

## Return value

A flat array of field and value pairs, in RESP2 and RESP3, in the order
listed above. `enterprise_features` is a bulk string; every other value is
an integer. Errors:

| Case | Error |
| --- | --- |
| Unknown subcommand | `ERR unknown OBSERVE subcommand '<name>' - try OBSERVE INFO or OBSERVE METRICS` |
| No license that includes `enterprise-observability` | `NOLICENSE enterprise-observability requires a HotKV license. Contact sales@hotkv.com` |

## Examples

```
127.0.0.1:6379> OBSERVE METRICS
 1) "uptime_seconds"
 2) (integer) 86412
 3) "connected_clients"
 4) (integer) 37
 5) "total_commands"
 6) (integer) 918273645
 7) "total_connections"
 8) (integer) 4120
 9) "used_memory_bytes"
10) (integer) 2147483648
11) "peak_memory_bytes"
12) (integer) 2415919104
13) "slowlog_length"
14) (integer) 12
15) "alerts_sent"
16) (integer) 3
17) "alerts_failed"
18) (integer) 0
19) "num_workers"
20) (integer) 8
```

## Compatibility

HotKV-only command.

## See also

[INFO](https://docs.hotkv.com/commands/info/index.md), [ALERTS](https://docs.hotkv.com/commands/alerts/index.md),
[LICENSE.INFO](https://docs.hotkv.com/commands/license-info/index.md)