This module enables prometheus metrics for Caddy.
In your Caddyfile
:
prometheus
For each virtual host that you want to see metrics for.
These are the (optional) parameters that can be used:
localhost:9180
/metrics
host
parameter that can be found in the exported metrics, this defaults to the label specified for the server blocklabel route_name {<X-Route-Name}
With caddyext
you'll need to put this module early in the chain, so that
the duration histogram actually makes sense. I've put it at number 0.
The following metrics are exported:
Each metric has the following labels:
host
which is the hostname used for the request/response,family
which is the protocol family, either 1 (IP version 4) or 2 (IP version 6),proto
which is the HTTP protocol major and minor version used: 1.x or 2 signifying HTTP/1.x or HTTP/2.The response_*
metrics have an extra label status
which holds the status code.