# Metrics

URL: https://docs.hanzo.ai/docs/cli/metrics

> The `hanzo metrics` commands.

Also for this capability: [API](https://docs.hanzo.ai/docs/openapi/metrics) · **CLI** · [SDKs](https://docs.hanzo.ai/docs/sdks)

[API reference →](https://docs.hanzo.ai/docs/openapi/metrics)

```bash
hanzo metrics query
```

Every command takes `--json` for the raw response and `--help` for its own flags. Sign in once with `hanzo auth login`; the commands below use that session, and the org they act in is the one it carries.

| Command                | What it does                                                      |
| ---------------------- | ----------------------------------------------------------------- |
| `hanzo metrics batch`  | Ingest a MetricBatch — the same payload the ZAP transport carries |
| `hanzo metrics health` | How many metric series this deployment holds for your org         |
| `hanzo metrics query`  | Read your org's series back over a time range                     |
| `hanzo metrics write`  | Append samples to your org's named, labelled series               |

### Logs

| Command                     | What it does                                            |
| --------------------------- | ------------------------------------------------------- |
| `hanzo metrics logs health` | How many log records this deployment holds for your org |
| `hanzo metrics logs query`  | Search your org's logs by label, time and substring     |
| `hanzo metrics logs write`  | Append structured log records for your org              |

### Traces

| Command                       | What it does                                      |
| ----------------------------- | ------------------------------------------------- |
| `hanzo metrics traces health` | How many spans this deployment holds for your org |
| `hanzo metrics traces query`  | Recent spans for your org over a time range       |
| `hanzo metrics traces trace`  | Every span of one trace — the waterfall           |
| `hanzo metrics traces write`  | Append spans for your org                         |
