Merge pull request #2466 from tifayuki/prometheus_go_metrics

add prometheus metrics
This commit is contained in:
Stephen Day 2018-02-09 15:49:04 -08:00 committed by GitHub
commit 6664ec7039
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
113 changed files with 17182 additions and 8 deletions

View file

@ -218,6 +218,9 @@ http:
hosts: [myregistryaddress.org]
debug:
addr: localhost:5001
prometheus:
enabled: true
path: /metrics
headers:
X-Content-Type-Options: [nosniff]
http2:
@ -805,6 +808,19 @@ access to the debug endpoint is locked down in a production environment.
The `debug` section takes a single required `addr` parameter, which specifies
the `HOST:PORT` on which the debug server should accept connections.
## `prometheus`
The `prometheus` option defines whether the prometheus metrics is enable, as well
as the path to access the metrics.
| Parameter | Required | Description |
|-----------|----------|-------------------------------------------------------|
| `enabled` | no | Set `true` to enable the prometheus server |
| `path` | no | The path to access the metrics, `/metrics` by default |
The url to access the metrics is `HOST:PORT/path`, where `HOST:PORT` is defined
in `addr` under `debug`.
### `headers`
The `headers` option is **optional** . Use it to specify headers that the HTTP