Observability
mistralrs serve writes operational logs through the normal tracing subscriber, so access logs appear in the same stdout/stderr stream as startup logs. mistralrs from-config uses the same server path and the same defaults.
Access logs
Section titled “Access logs”Access logs are enabled by default. For each non-housekeeping request, the server logs:
request started: request id, method, matched route, raw path, resolved model id, and request content length when present.request completed: request id, method, matched route, resolved model id, status, and duration in milliseconds rounded to three decimal places.
Housekeeping endpoints and CORS preflight requests are skipped by default. Housekeeping endpoints include /, /health, /metrics, /docs, /api-doc/openapi.json, and /ui. Use --access-log-health if you want probes and docs/UI requests in the access log too.
Useful flags:
| Flag | Default | Effect |
|---|---|---|
| --disable-access-log | false | Turns off info-level HTTP access logs. |
| --access-log-format text | text | Uses structured tracing fields for access logs. |
| --access-log-format json | text | Logs each access-log message as a JSON object string. |
| --access-log-health | false | Includes housekeeping endpoints in access logs. |
The global -v, -vv, and RUST_LOG controls still decide which tracing levels are emitted. --disable-access-log only disables the info-level HTTP access log events.
Request ids
Section titled “Request ids”The server honors an incoming x-request-id header when present, otherwise it generates one. The value is added to access logs and echoed as the x-request-id response header.
The default CORS configuration allows browser clients to send x-request-id and exposes the response header.
Use --disable-request-id-header to stop adding the response header. The request id is still generated internally for access logs.
Prometheus metrics
Section titled “Prometheus metrics”GET /metrics exposes Prometheus text format by default. The HTTP middleware records:
| Metric | Type | Labels | Meaning |
|---|---|---|---|
| http_requests_total | counter | method, path, model, status | Completed request count. |
| http_request_duration_seconds | histogram | method, path, model, status | End-to-end request latency. |
| http_requests_in_flight | gauge | method, path, model | Requests currently running. |
| http_request_body_bytes | histogram | method, path, model | Request body bytes when the body size is known. |
Duration and body-size metrics are exported as Prometheus histograms with fixed buckets.
The path label is the matched route pattern, such as /v1/responses/{response_id}, not the raw URI. The model label is the resolved model id for inference requests, defaults to the server default model when the request omits model, uses explicit model_id values for model-management requests, uses unknown when the request body cannot be read or parsed as JSON, and uses none for routes that do not target a model. Unmatched requests are labeled <unmatched>. Housekeeping endpoints are excluded from HTTP metrics to keep scrape and probe traffic out of request dashboards.
Use --disable-metrics to avoid installing the Prometheus recorder. When metrics are disabled or not initialized, GET /metrics returns 503.
The same controls are available under [server]:
[server]host = "0.0.0.0"port = 1234
disable_access_log = falseaccess_log_format = "text" # "text" or "json"access_log_health = falsedisable_request_id_header = falsedisable_metrics = falseFor endpoint semantics, see the HTTP API reference. For deployment checks, see the production checklist.