add host metrics (#3277)

* add host metrics

Signed-off-by: yeya24 <yb532204897@gmail.com>

* update hosts readme docs

Signed-off-by: yeya24 <yb532204897@gmail.com>
This commit is contained in:
yeya24
2019-09-19 11:38:15 -04:00
committed by Miek Gieben
parent 62317c3c14
commit 85e65702bd
4 changed files with 35 additions and 1 deletions

View File

@@ -72,6 +72,13 @@ hosts [FILE [ZONES...]] {
is authoritative. If specific zones are listed (for example `in-addr.arpa` and `ip6.arpa`), then only
queries for those zones will be subject to fallthrough.
## Metrics
If monitoring is enabled (via the *prometheus* directive) then the following metrics are exported:
- `coredns_hosts_entries_count{}` - The combined number of entries in hosts and Corefile.
- `coredns_hosts_reload_timestamp_seconds{}` - The timestamp of the last reload of hosts file.
## Examples
Load `/etc/hosts` file.