mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 20:46:15 -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.
|
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
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue