You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
441 B
Go
20 lines
441 B
Go
package metrics
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
func RegisterInfoMetric(version, gitCommit string) error {
|
|
infoMetric := prometheus.NewGauge(prometheus.GaugeOpts{
|
|
Name: metricPrefix + "exporter_info",
|
|
Help: "Information about the nextcloud-exporter.",
|
|
ConstLabels: prometheus.Labels{
|
|
"version": version,
|
|
"commit": gitCommit,
|
|
},
|
|
})
|
|
infoMetric.Set(1)
|
|
|
|
return prometheus.Register(infoMetric)
|
|
}
|