From 0d629fd34301550299388ee0bd68dc2aa6f3108f Mon Sep 17 00:00:00 2001 From: Daniel Ruggeri Date: Fri, 24 Apr 2020 20:41:14 -0500 Subject: [PATCH] Do not repeat "leases" in metric name --- README.md | 4 ++-- collectors/stats_collector.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ad044dd..7ae3ab3 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,8 @@ Flags: This collector counts the number of leases PER UNIQUE IP found in dhcpd.leases. This means that if an IP was leased to `client X`, but is now leased to `client Y`, there will be only one entry counted (the most recent one). This is in line with how dhcpd reads the file. ``` - dhcpd_leases_stats_valid_leases - The number of leases in dhcpd.leases that have not yet expired. - dhcpd_leases_stats_expired_leases - The number of leases in dhcpd.leases that have expired. + dhcpd_leases_stats_valid - The number of leases in dhcpd.leases that have not yet expired. + dhcpd_leases_stats_expired - The number of leases in dhcpd.leases that have expired. dhcpd_leases_stats_count - The number of leases in dhcpd.leases dhcpd_leases_stats_scrapes_total - Total number of scrapes for stats. dhcpd_leases_stats_scrape_errors_total - Total number of scrapes errors for stats. diff --git a/collectors/stats_collector.go b/collectors/stats_collector.go index cf96228..a1b3886 100644 --- a/collectors/stats_collector.go +++ b/collectors/stats_collector.go @@ -26,7 +26,7 @@ func NewStatsCollector(namespace string, info *dhcpdleasesreader.DhcpdInfo) *Sta prometheus.GaugeOpts{ Namespace: namespace, Subsystem: "stats", - Name: "valid_leases", + Name: "valid", Help: "The number of leases in dhcpd.leases that have not yet expired.", }, ) @@ -35,7 +35,7 @@ func NewStatsCollector(namespace string, info *dhcpdleasesreader.DhcpdInfo) *Sta prometheus.GaugeOpts{ Namespace: namespace, Subsystem: "stats", - Name: "expired_leases", + Name: "expired", Help: "The number of leases in dhcpd.leases that have expired.", }, )