From 437028e692c5cbc6ea0f2850c1ce8c9bbf08266c Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Sun, 19 May 2024 17:14:24 +0100 Subject: [PATCH] unbound_exporter.go: Fixed startup message log output formatting --- unbound_exporter.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/unbound_exporter.go b/unbound_exporter.go index 291bb00..d625687 100644 --- a/unbound_exporter.go +++ b/unbound_exporter.go @@ -34,6 +34,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/promlog" + "github.com/prometheus/common/version" ) var ( @@ -548,7 +549,7 @@ func main() { ) flag.Parse() - _ = level.Info(log).Log("Starting unbound_exporter") + _ = level.Info(log).Log("msg", "Starting unbound_exporter", "version", version.Info()) exporter, err := NewUnboundExporter(*unboundHost, *unboundCa, *unboundCert, *unboundKey) if err != nil { panic(err) @@ -566,7 +567,7 @@ func main() { `)) }) - _ = level.Info(log).Log("Listening on address:port => ", *listenAddress) - _ = level.Error(log).Log(http.ListenAndServe(*listenAddress, nil)) + _ = level.Info(log).Log("msg", "Listening on address:port => ", *listenAddress) + _ = level.Error(log).Log("err", http.ListenAndServe(*listenAddress, nil)) os.Exit(1) }