docs: metrics directive: Document disable_openmetrics (#123)

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
This commit is contained in:
Dave Henderson 2020-12-30 13:01:37 -05:00 committed by GitHub
parent 01140e3f75
commit 54d309cc34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}
```