mirror of
https://github.com/rancher/norman.git
synced 2025-09-25 06:26:50 +00:00
21 lines
377 B
Go
21 lines
377 B
Go
package metrics
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
const metricsEnv = "CATTLE_PROMETHEUS_METRICS"
|
|
|
|
var prometheusMetrics = false
|
|
|
|
func init() {
|
|
if os.Getenv(metricsEnv) == "true" {
|
|
prometheusMetrics = true
|
|
// Generic controller metrics
|
|
prometheus.MustRegister(TotalHandlerExecution)
|
|
prometheus.MustRegister(TotalHandlerFailure)
|
|
}
|
|
}
|