friendica-exporter/internal/metrics/info.go
2024-10-27 19:51:26 +01:00

18 lines
441 B
Go

package metrics
import "github.com/prometheus/client_golang/prometheus"
func RegisterStatsMetrics(version, gitCommit string) error {
statsMetric := prometheus.NewGauge(prometheus.GaugeOpts{
Name: metricPrefix + "exporter_info",
Help: "Information about the friendica-exporter.",
ConstLabels: prometheus.Labels{
"version": version,
"commit": gitCommit,
},
})
statsMetric.Set(1)
return prometheus.Register(statsMetric)
}