mirror of
https://github.com/coredns/coredns.git
synced 2025-12-09 03:45:11 -05:00
middleware/metrics: cleanup (#355)
* middleware/metrics: add more metrics middleware/cache: Add metrics for number of elements in the cache. Also export the total size. Update README to detail the new metrics. middleware/metrics Move metrics into subpackage called "vars". This breaks the import cycle and is cleaner. This allows vars.Report to be used in the the dnsserver to log refused queries. middleware/metrics: tests Add tests to the metrics framework. The metrics/test subpackage allows scraping of the local server. Do a few test scrape of the metrics that are defined in the metrics middleware. This also allows metrics integration tests to check if the caching and dnssec middleware export their metrics correctly. * update README * typos * fix tests
This commit is contained in:
@@ -7,12 +7,10 @@ The following metrics are exported:
|
||||
|
||||
* coredns_dns_request_count_total{zone, proto, family}
|
||||
* coredns_dns_request_duration_milliseconds{zone}
|
||||
* coredns_dns_request_size_bytes{zone,, proto}
|
||||
* coredns_dns_request_transfer_size_bytes{zone,, proto}
|
||||
* coredns_dns_request_size_bytes{zone, proto}
|
||||
* coredns_dns_request_do_count_total{zone}
|
||||
* coredns_dns_request_type_count_total{zone, type}
|
||||
* coredns_dns_response_size_bytes{zone, proto}
|
||||
* coredns_dns_response_transfer_size_bytes{zone, proto}
|
||||
* coredns_dns_response_rcode_count_total{zone, rcode}
|
||||
|
||||
Each counter has a label `zone` which is the zonename used for the request/response.
|
||||
@@ -27,10 +25,7 @@ Extra labels used are:
|
||||
* The `response_rcode_count_total` has an extra label `rcode` which holds the rcode of the response.
|
||||
|
||||
If monitoring is enabled, queries that do not enter the middleware chain are exported under the fake
|
||||
domain "dropped" (without a closing dot).
|
||||
|
||||
Restarting CoreDNS will stop the monitoring. This is a bug. Also [this upstream
|
||||
Caddy bug](https://github.com/mholt/caddy/issues/675).
|
||||
name "dropped" (without a closing dot - this is never a valid domain name).
|
||||
|
||||
## Syntax
|
||||
|
||||
@@ -44,3 +39,9 @@ It optionally takes an address to which the metrics are exported; the default
|
||||
is `localhost:9153`. The metrics path is fixed to `/metrics`.
|
||||
|
||||
## Examples
|
||||
|
||||
Use an alternative address:
|
||||
|
||||
~~~
|
||||
prometheus localhost:9253
|
||||
~~~
|
||||
|
||||
Reference in New Issue
Block a user