| 1 | package metrics |
| 2 | |
| 3 | import ( |
| 4 | "github.com/prometheus/client_golang/prometheus" |
| 5 | ) |
| 6 | |
| 7 | func RegisterInfoMetric(version, gitCommit string) error { |
| 8 | infoMetric := prometheus.NewGauge(prometheus.GaugeOpts{ |
| 9 | Name: metricPrefix + "exporter_info", |
| 10 | Help: "Information about the nextcloud-exporter.", |
| 11 | ConstLabels: prometheus.Labels{ |
| 12 | "version": version, |
| 13 | "commit": gitCommit, |
| 14 | }, |
| 15 | }) |
| 16 | infoMetric.Set(1) |
| 17 | |
| 18 | return prometheus.Register(infoMetric) |
| 19 | } |