---
title: "metrics in config.yaml"
url: https://devlanes.run/docs/reference/config/user/metrics/
description: "Reference for the metrics key in ~/.devlanes/config.yaml."
---

# metrics in config.yaml

A top-level key of [`~/.devlanes/config.yaml`](/docs/reference/config/user/).

## `metrics`

Type: mapping.

How long CPU and memory history stays in the daemon's database.

```yaml devlanes-user
metrics:
  retention: 7d
```

### `metrics.retention`

Type: [duration](/docs/reference/config/#durations). Default: `7d`.

How long per-minute CPU and memory samples, per-run summaries and startup memory peaks are kept; defaults to `7d` and must be longer than `0s`. Shorter keeps less history for graphs and for the memory a start is expected to need; `state.max_size` can delete samples sooner.

```yaml devlanes-user
metrics:
  retention: 7d
```
