---
url: /apranik/configuration/stats.md
---
# Stats

What Apranik counts: traffic per inbound, outbound and user, failures by reason,
routing rule hits and the resolver's work. Counting is on by default; this section
narrows it or turns on the parts that cost extra. The numbers are read through an
[API](../api/index.md). See [Counters](counters.md) for what each one means.

## Structure

```json
{
  "stats": {
    "enabled": true,
    "inbounds": ["socks-in"],
    "outbounds": ["proxy"],
    "dial_health": false,
    "tracking": {
      "enabled": true,
      "udp_entry_idle_timeout": "1m",
      "udp_max_entries_per_session": 1024
    }
  }
}
```

## Fields

### `enabled`

boolean
Default: true

Count anything at all. `false` turns off every key below.

### `inbounds`

list of tags
Default: all

Count only these inbounds.

### `outbounds`

list of tags
Default: all

Count only these outbounds. Every authenticated user is always counted.

### `dial_health`

boolean
Default: false

Time every dial of every outbound.

### `tracking.enabled`

boolean
Default: on when apis is set

Keep the live list of open TCP connections and UDP destinations, so an API can list
and close them and show who is online. About 350 bytes per entry.

### `tracking.udp_entry_idle_timeout`

duration
Default: 1m

A UDP destination leaves the live list after this much silence either way.

### `tracking.udp_max_entries_per_session`

integer
Default: 1024

The most destinations one UDP session lists; the one used longest ago goes first.
