forked from Syncano/rabbitmq_exporter
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kris Budde <Kris.Budde@gmail.com>
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
package main | ||
|
||
import "github.com/prometheus/client_golang/prometheus" | ||
|
||
var ( | ||
Version string | ||
Revision string | ||
Branch string | ||
BuildDate string | ||
) | ||
|
||
//BuildInfo is a metric with a constant '1' value labeled by version, revision, branch and build date on which the rabbitmq_exporter was built | ||
var BuildInfo *prometheus.GaugeVec | ||
|
||
func init() { | ||
BuildInfo = newBuildInfo() | ||
} | ||
|
||
func newBuildInfo() *prometheus.GaugeVec { | ||
metric := prometheus.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Name: "rabbitmq_exporter_build_info", | ||
Help: "A metric with a constant '1' value labeled by version, revision, branch and build date on which the rabbitmq_exporter was built.", | ||
}, | ||
[]string{"version", "revision", "branch", "builddate"}, | ||
) | ||
metric.WithLabelValues(Version, Revision, Branch, BuildDate).Set(1) | ||
return metric | ||
} |