mirror of
https://github.com/caddyserver/website.git
synced 2025-07-01 10:22:15 -04:00
docs: Monitoring and metrics (#86)
* metrics: Adding docs for metrics Signed-off-by: Dave Henderson <dhenderson@gmail.com> * Addressing review comments Signed-off-by: Dave Henderson <dhenderson@gmail.com> * Apply suggestions from code review Co-authored-by: Matt Holt <mholt@users.noreply.github.com> * Update src/docs/markdown/metrics.md Co-authored-by: Dave Henderson <dhenderson@gmail.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
2c6a8a0f9f
commit
30084b98b0
4 changed files with 303 additions and 2 deletions
45
src/docs/markdown/caddyfile/directives/metrics.md
Normal file
45
src/docs/markdown/caddyfile/directives/metrics.md
Normal file
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
title: metrics (Caddyfile directive)
|
||||
---
|
||||
|
||||
# metrics
|
||||
|
||||
Configures a Prometheus metrics exposition endpoint so the gathered metrics can
|
||||
be exposed for scraping.
|
||||
|
||||
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)
|
||||
(`application/openmetrics-text`).
|
||||
|
||||
See also [Monitoring Caddy with Prometheus metrics](/docs/metrics).
|
||||
|
||||
## Syntax
|
||||
|
||||
```caddy-d
|
||||
metrics [<matcher>]
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
Expose metrics at the default `/metrics` path:
|
||||
|
||||
```caddy-d
|
||||
metrics /metrics
|
||||
```
|
||||
|
||||
Expose metrics at another path:
|
||||
|
||||
```caddy-d
|
||||
metrics /foo/bar/baz
|
||||
```
|
||||
|
||||
Serve metrics at a separate subdomain:
|
||||
|
||||
```caddy
|
||||
metrics.example.com {
|
||||
metrics
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue