metrics: Document the disable_openmetrics option

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
This commit is contained in:
Dave Henderson 2020-12-30 08:28:08 -05:00
parent 9dd9309a9b
commit a97b055a98
No known key found for this signature in database
GPG key ID: 765A97405DCE5AFA

View file

@ -11,7 +11,7 @@ Note that a `/metrics` endpoint is also attached to the [admin API](/docs/api),
which is not configurable, and is not available when the admin API is disabled. which is not configurable, and is not available when the admin API is disabled.
This endpoint will return metrics in the [Prometheus exposition format](https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format) This endpoint will return metrics in the [Prometheus exposition format](https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format)
or, if negotiated, in the [OpenMetrics exposition format](https://pkg.go.dev/github.com/prometheus/client_golang@v1.7.1/prometheus/promhttp#HandlerOpts) or, if negotiated, in the [OpenMetrics exposition format](https://pkg.go.dev/github.com/prometheus/client_golang@v1.9.0/prometheus/promhttp#HandlerOpts)
(`application/openmetrics-text`). (`application/openmetrics-text`).
See also [Monitoring Caddy with Prometheus metrics](/docs/metrics). See also [Monitoring Caddy with Prometheus metrics](/docs/metrics).
@ -19,9 +19,14 @@ See also [Monitoring Caddy with Prometheus metrics](/docs/metrics).
## Syntax ## Syntax
```caddy-d ```caddy-d
metrics [<matcher>] metrics [<matcher>] {
disable_openmetrics
}
``` ```
- **disable_openmetrics** disables OpenMetrics negotiation. Usually not
necessary except when needing to work around parsing bugs.
## Examples ## Examples
Expose metrics at the default `/metrics` path: Expose metrics at the default `/metrics` path:
@ -43,3 +48,11 @@ metrics.example.com {
metrics metrics
} }
``` ```
Disable OpenMetrics negotiation:
```caddy-d
metrics /metrics {
disable_openmetrics
}
```