From 775eb974abe43720b7598cd294e43124adc10509 Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Wed, 17 Apr 2024 20:06:42 +0200 Subject: [PATCH 1/4] update metric name --- collector/collector.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/collector.go b/collector/collector.go index 536f92a..e5f9e4c 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -102,7 +102,7 @@ func (c Collector) collect(ch chan<- prometheus.Metric, logger log.Logger) { } // TODO: Test or delete - serverScoreMetric := prometheus.NewDesc("ntppool_score", + serverScoreMetric := prometheus.NewDesc("ntppool_server_score", "Shows the server score currently assigned at ntppool.org", nil, prometheus.Labels{"server": c.target.String()}) From 2d88d8a13f37b073e18d6dab19d45471b4345b32 Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Wed, 17 Apr 2024 20:07:00 +0200 Subject: [PATCH 2/4] remove unneeded label --- collector/collector.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/collector.go b/collector/collector.go index e5f9e4c..c416394 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -104,7 +104,7 @@ func (c Collector) collect(ch chan<- prometheus.Metric, logger log.Logger) { // TODO: Test or delete serverScoreMetric := prometheus.NewDesc("ntppool_server_score", "Shows the server score currently assigned at ntppool.org", - nil, prometheus.Labels{"server": c.target.String()}) + nil, nil) // TODO: Test or delete //c.metrics.NtpppolServerScore.Add(serverApiScore) From 046324f0980bc5d75790516d0c33e547681621b2 Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Wed, 17 Apr 2024 20:07:24 +0200 Subject: [PATCH 3/4] add binary folders to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index db26547..1b72e63 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,9 @@ go.work # vscode Go debugging files __debug_* +ntppool-exporter +bin/ # vscode editor config .vscode/ + From bddc702ef3292640218b30a08204e26eabd082c3 Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Wed, 17 Apr 2024 20:08:30 +0200 Subject: [PATCH 4/4] fix MISSING in Debug log --- collector/collector.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/collector.go b/collector/collector.go index c416394..7a332e4 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -52,7 +52,7 @@ func (c Collector) Describe(ch chan<- *prometheus.Desc) { // Collect implements Prometheus.Collector. func (c Collector) Collect(ch chan<- prometheus.Metric) { - logger := log.With(c.logger, "scraper") + logger := log.With(c.logger, "module", "scraper") level.Debug(logger).Log("msg", "Starting scrape") start := time.Now() c.collect(ch, logger)