Skip to content

Commit

Permalink
add the Version Collector Metric
Browse files Browse the repository at this point in the history
To get information which version of the IPMI Exporter is running,
add the VersionCollector from the Prometheus Golang Client.
  • Loading branch information
antondollmaier committed Feb 12, 2025
1 parent e679bb0 commit 84d3a7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

kingpin "github.com/alecthomas/kingpin/v2"
"github.com/prometheus/client_golang/prometheus"
versioncollector "github.com/prometheus/client_golang/prometheus/collectors/version"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/promslog"
"github.com/prometheus/common/promslog/flag"
Expand Down Expand Up @@ -128,6 +129,7 @@ func main() {
}
}()

prometheus.MustRegister(versioncollector.NewCollector("ipmi_exporter"))
localCollector := metaCollector{target: targetLocal, module: "default", config: sc}
prometheus.MustRegister(&localCollector)

Expand Down

0 comments on commit 84d3a7a

Please sign in to comment.