mirror of
https://github.com/rancher/norman.git
synced 2025-06-28 08:17:14 +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"
|
"k8s.io/client-go/util/workqueue"
|
||||||
)
|
)
|
||||||
|
|
||||||
const MetricsEnv = "NORMAN_QUEUE_METRICS"
|
const MetricsQueueEnv = "NORMAN_QUEUE_METRICS"
|
||||||
|
const MetricsReflectorEnv = "NORMAN_REFLECTOR_METRICS"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
resyncPeriod = 2 * time.Hour
|
resyncPeriod = 2 * time.Hour
|
||||||
@ -31,8 +32,11 @@ var (
|
|||||||
|
|
||||||
// Override the metrics providers
|
// Override the metrics providers
|
||||||
func init() {
|
func init() {
|
||||||
if os.Getenv(MetricsEnv) != "true" {
|
if os.Getenv(MetricsQueueEnv) != "true" {
|
||||||
DisableAllControllerMetrics()
|
DisableControllerWorkqueuMetrics()
|
||||||
|
}
|
||||||
|
if os.Getenv(MetricsReflectorEnv) != "true" {
|
||||||
|
DisableControllerReflectorMetrics()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user