mirror of
https://github.com/rancher/steve.git
synced 2025-09-19 10:26:25 +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)
|
||
|
}
|
||
|
}
|