caddy_metrics
Get Caddy Prometheus metrics covering request counts, durations, TLS handshake stats, and active connections. Filter by metric name and limit output lines to handle large responses.
Instructions
Get Prometheus metrics from Caddy. Shows request counts, durations, TLS handshake stats, active connections, and more. Output can be megabytes on busy servers -- use filter to keep only metrics whose name contains a substring (e.g. 'http_requests' or 'tls'); HELP/TYPE comment lines for retained metrics are kept. Filter-mode drops blank lines and free-form '# comment' lines, keeping only '# HELP'/'# TYPE' lines for matching metrics; the '# EOF' end-of-file marker is always preserved. Use max_lines to cap the response (default 500); a trailing comment reports how many lines were dropped.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Substring to match against metric names. Keeps sample lines whose metric name contains this substring, plus their `# HELP` and `# TYPE` comment lines. Empty/absent = no filtering. Label values are NOT matched -- use a Prometheus-aware client for label filtering. | |
| max_lines | No | Maximum number of output lines (default 500). Excess lines are dropped and a summary is appended. |