Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/miekg/caddy-prometheus

Prometheus metrics middleware for caddy
https://github.com/miekg/caddy-prometheus

caddy go metrics prometheus

Last synced: 3 months ago
JSON representation

Prometheus metrics middleware for caddy

Lists

README

        

# Metrics

This module enables prometheus metrics for Caddy.

## Use

In your `Caddyfile`:

~~~
prometheus
~~~

For each virtual host that you want to see metrics for.

These are the (optional) parameters that can be used:

- **use_caddy_addr** - causes metrics to be exposed at the same address:port as Caddy itself. This can not be specified at the same time as **address**.
- **address** - the address where the metrics are exposed, the default is `localhost:9180`
- **path** - the path to serve collected metrics from, the default is `/metrics`
- **hostname** - the `host` parameter that can be found in the exported metrics, this defaults to the label specified for the server block
- **label** - Custom label to add on all metrics.
This directive can be used multiple times.
You should specify a label name and a value.
The value is a [placeholder](https://caddyserver.com/docs/placeholders) and can be used to extract value from response header for instance.
Usage: `label route_name {