Example #1
0
func init() {
	buildInfo := prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "kubernetes_build_info",
			Help: "A metric with a constant '1' value labeled by major, minor, git version, git commit and git tree state from which Kubernetes was built.",
		},
		[]string{"major", "minor", "gitVersion", "gitCommit", "gitTreeState"},
	)
	info := Get()
	buildInfo.WithLabelValues(info.Major, info.Minor, info.GitVersion, info.GitCommit, info.GitTreeState).Set(1)

	prometheus.MustRegister(buildInfo)
}
Example #2
0
func init() {
	prometheus.MustRegister(tunnelOpenCounter)
	prometheus.MustRegister(tunnelOpenFailCounter)
}
Example #3
0
// Register registers all metrics to Prometheus with
// respect to the RequestLatency.
func Register() {
	// Register the metrics.
	registerMetrics.Do(func() {
		prometheus.MustRegister(RequestLatency)
	})
}