Exemplo n.º 1
0
// Register registers all metrics to Prometheus with
// respect to the RequestLatency.
func Register() {
	// Register the metrics.
	registerMetrics.Do(func() {
		prometheus.MustRegister(RequestLatency)
		prometheus.MustRegister(RequestResult)
	})
}
Exemplo n.º 2
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)
}
Exemplo n.º 3
0
func init() {
	prometheus.MustRegister(tunnelOpenCounter)
	prometheus.MustRegister(tunnelOpenFailCounter)
}