Documentation
a project

metrics

Configures a Prometheus metrics exposition endpoint so the gathered metrics can be exposed for scraping.

Note that a /metrics endpoint is also attached to the admin API, which is not configurable, and is not available when the admin API is disabled.

This endpoint will return metrics in the Prometheus exposition format or, if negotiated, in the OpenMetrics exposition format (application/openmetrics-text).

See also Monitoring Caddy with Prometheus metrics.

Syntax

metrics [<matcher>]

Examples

Expose metrics at the default /metrics path:

metrics /metrics

Expose metrics at another path:

metrics /foo/bar/baz

Serve metrics at a separate subdomain:

metrics.example.com {
	metrics
}