hosts: add hostsfile as label for coredns_hosts_entries (#6801)

Signed-off-by: Paco Xu <paco.xu@daocloud.io>
This commit is contained in:
Paco Xu
2024-08-06 19:13:22 +08:00
committed by GitHub
parent ae65f4e0c7
commit e5945d2767
2 changed files with 2 additions and 2 deletions

View File

@@ -138,7 +138,7 @@ func (h *Hostsfile) readHosts() {
h.mtime = stat.ModTime()
h.size = stat.Size()
hostsEntries.WithLabelValues().Set(float64(h.inline.Len() + h.hmap.Len()))
hostsEntries.WithLabelValues(h.path).Set(float64(h.inline.Len() + h.hmap.Len()))
hostsReloadTime.Set(float64(stat.ModTime().UnixNano()) / 1e9)
h.Unlock()
}