mirror of
https://github.com/rancher/norman.git
synced 2025-06-27 15:57:00 +00:00
Merge pull request #201 from ukinau/Enable-fine-grained-control-for-controller-related-metrics
Enable fine-grained control for Controller related metrics
This commit is contained in:
commit
c580ac3ab0
@ -23,7 +23,8 @@ import (
|
||||
"k8s.io/client-go/util/workqueue"
|
||||
)
|
||||
|
||||
const MetricsEnv = "NORMAN_QUEUE_METRICS"
|
||||
const MetricsQueueEnv = "NORMAN_QUEUE_METRICS"
|
||||
const MetricsReflectorEnv = "NORMAN_REFLECTOR_METRICS"
|
||||
|
||||
var (
|
||||
resyncPeriod = 2 * time.Hour
|
||||
@ -31,8 +32,11 @@ var (
|
||||
|
||||
// Override the metrics providers
|
||||
func init() {
|
||||
if os.Getenv(MetricsEnv) != "true" {
|
||||
DisableAllControllerMetrics()
|
||||
if os.Getenv(MetricsQueueEnv) != "true" {
|
||||
DisableControllerWorkqueuMetrics()
|
||||
}
|
||||
if os.Getenv(MetricsReflectorEnv) != "true" {
|
||||
DisableControllerReflectorMetrics()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user