mirror of
https://github.com/rancher/steve.git
synced 2025-04-27 19:05:09 +00:00
19 lines
364 B
Go
19 lines
364 B
Go
package metrics
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
const metricsEnv = "CATTLE_PROMETHEUS_METRICS"
|
|
|
|
func init() {
|
|
if os.Getenv(metricsEnv) == "true" {
|
|
prometheusMetrics = true
|
|
prometheus.MustRegister(ProxyTotalResponses)
|
|
prometheus.MustRegister(K8sClientResponseTime)
|
|
prometheus.MustRegister(ProxyStoreResponseTime)
|
|
}
|
|
}
|