mirror of
https://github.com/unpoller/unpoller.git
synced 2026-04-05 08:54:00 -04:00
Add a build info metric to Prometheus
Include `unifi_poller_build_info` as a Prometheus metric. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/davidnewhall/unifi-poller/pkg/promunifi"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/prometheus/common/version"
|
||||
)
|
||||
|
||||
const oneDecimalPoint = 10
|
||||
@@ -24,6 +25,9 @@ func (u *UnifiPoller) RunPrometheus() error {
|
||||
ReportErrors: true, // XXX: Does this need to be configurable?
|
||||
}))
|
||||
|
||||
version.Version = Version
|
||||
prometheus.MustRegister(version.NewCollector("unifipoller"))
|
||||
|
||||
return http.ListenAndServe(u.Config.HTTPListen, nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user