From 87214a4c5c05c8918bfe73f734ff4dbd390319dd Mon Sep 17 00:00:00 2001 From: Zou Nengren Date: Tue, 31 Mar 2020 14:07:36 +0800 Subject: introduce metric naming test (#3789) * introduce metric naming test Signed-off-by: zounengren * Update metrics.go Signed-off-by: zounengren --- plugin/hosts/metrics.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 plugin/hosts/metrics.go (limited to 'plugin/hosts/metrics.go') diff --git a/plugin/hosts/metrics.go b/plugin/hosts/metrics.go new file mode 100644 index 000000000..f20a07775 --- /dev/null +++ b/plugin/hosts/metrics.go @@ -0,0 +1,24 @@ +package hosts + +import ( + "github.com/coredns/coredns/plugin" + + "github.com/prometheus/client_golang/prometheus" +) + +var ( + // hostsEntries is the combined number of entries in hosts and Corefile. + hostsEntries = prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Namespace: plugin.Namespace, + Subsystem: "hosts", + Name: "entries", + Help: "The combined number of entries in hosts and Corefile.", + }, []string{}) + // hostsReloadTime is the timestamp of the last reload of hosts file. + hostsReloadTime = prometheus.NewGauge(prometheus.GaugeOpts{ + Namespace: plugin.Namespace, + Subsystem: "hosts", + Name: "reload_timestamp_seconds", + Help: "The timestamp of the last reload of hosts file.", + }) +) -- cgit v1.2.3