From 54d309cc34d2ce00c56ec0777ebb26e43c914a93 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Wed, 30 Dec 2020 13:01:37 -0500 Subject: [PATCH] docs: metrics directive: Document disable_openmetrics (#123) Signed-off-by: Dave Henderson --- .../markdown/caddyfile/directives/metrics.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/docs/markdown/caddyfile/directives/metrics.md b/src/docs/markdown/caddyfile/directives/metrics.md index 40c38d6..938b31d 100644 --- a/src/docs/markdown/caddyfile/directives/metrics.md +++ b/src/docs/markdown/caddyfile/directives/metrics.md @@ -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 [] +metrics [] { + 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 +} +```