# Reference: server.metrics

URL: https://scalws.com/docs/reference/server-metrics/
Source: `docs/reference/schema` in the ScalWS repository

<h3 id="server.metrics.address"><code>server.metrics.address</code></h3>

| | |
|---|---|
| Syntax | `address: <string>` |
| Default | `127.0.0.1:9901` |
| Context | `server.metrics` |
| Reload | needs a restart |

Serves `/metrics` (Prometheus text format) and `/healthz`. Loopback by default.


<h3 id="server.metrics.enabled"><code>server.metrics.enabled</code></h3>

| | |
|---|---|
| Syntax | `enabled: true \| false` |
| Default | `true` |
| Context | `server.metrics` |
| Reload | needs a restart |

Serve the metrics listener.


<h3 id="server.metrics.hosts"><code>server.metrics.hosts</code></h3>

| | |
|---|---|
| Syntax | `hosts: true \| false` |
| Default | `true` |
| Context | `server.metrics` |
| Reload | applies on reload |

Per-domain counters (`scalws_http_host_*`): requests by status class, body bytes, cache hits, in-flight requests. One series set per configured domain pattern; hosts that match no domain are counted as `_other`.


<h3 id="server.metrics.max_hosts"><code>server.metrics.max_hosts</code></h3>

| | |
|---|---|
| Syntax | `max_hosts: <integer>` |
| Default | `1000` |
| Context | `server.metrics` |
| Reload | applies on reload |

Domains counted separately; further domains are counted as `_other` (at most 16383).
