mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 12:36:16 -04:00
docs: metrics directive: Document disable_openmetrics (#123)
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
This commit is contained in:
parent
01140e3f75
commit
54d309cc34
1 changed files with 15 additions and 2 deletions
|
@ -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.
|
||||
|
||||
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`).
|
||||
|
||||
See also [Monitoring Caddy with Prometheus metrics](/docs/metrics).
|
||||
|
@ -19,9 +19,14 @@ See also [Monitoring Caddy with Prometheus metrics](/docs/metrics).
|
|||
## Syntax
|
||||
|
||||
```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
|
||||
|
||||
Expose metrics at the default `/metrics` path:
|
||||
|
@ -43,3 +48,11 @@ metrics.example.com {
|
|||
metrics
|
||||
}
|
||||
```
|
||||
|
||||
Disable OpenMetrics negotiation:
|
||||
|
||||
```caddy-d
|
||||
metrics /metrics {
|
||||
disable_openmetrics
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue