diff options
Diffstat (limited to 'common/prometheus.go')
| -rw-r--r-- | common/prometheus.go | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/common/prometheus.go b/common/prometheus.go index f69854b..68fc42b 100644 --- a/common/prometheus.go +++ b/common/prometheus.go @@ -1,20 +1,20 @@ -package common - -import ( - "fmt" - "net/http" - - "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/rs/zerolog/log" -) - -// CreatePrometheus creates a webserver instance that returns the metrics of the -// current program reported using promauto. -func CreatePrometheus(port int) { - http.Handle("/metrics", promhttp.Handler()) - err := http.ListenAndServe(fmt.Sprintf(":%d", port), nil) - - if err != nil { - log.Err(err).Msgf("failed to start the prometheus reporting on the port :%d", port) - } -} +package common
+
+import (
+ "fmt"
+ "net/http"
+
+ "github.com/prometheus/client_golang/prometheus/promhttp"
+ "github.com/rs/zerolog/log"
+)
+
+// CreatePrometheus creates a webserver instance that returns the metrics of the
+// current program reported using promauto.
+func CreatePrometheus(port int) {
+ http.Handle("/metrics", promhttp.Handler())
+ err := http.ListenAndServe(fmt.Sprintf(":%d", port), nil)
+
+ if err != nil {
+ log.Err(err).Msgf("failed to start the prometheus reporting on the port :%d", port)
+ }
+}
|
