diff --git a/USERS.md b/USERS.md index 7909967498..21b55d8f34 100644 --- a/USERS.md +++ b/USERS.md @@ -13,6 +13,7 @@ Organizations below are **officially** using Argo Rollouts. Please send a PR wit 1. [Databricks](https://github.com/databricks) 1. [Devtron Labs](https://github.com/devtron-labs/devtron) 1. [Farfetch](https://www.farfetch.com/) +1. [Flipkart](https://flipkart.com) 1. [Gllue](https://gllue.com) 1. [Ibotta](https://home.ibotta.com/) 1. [Intuit](https://www.intuit.com/) diff --git a/cmd/rollouts-controller/main.go b/cmd/rollouts-controller/main.go index f94fc10ba9..f669a7115f 100644 --- a/cmd/rollouts-controller/main.go +++ b/cmd/rollouts-controller/main.go @@ -108,6 +108,9 @@ func newCommand() *cobra.Command { log.Infof("Using namespace %s", namespace) } + k8sRequestProvider := &metrics.K8sRequestsCountProvider{} + kubeclientmetrics.AddMetricsTransportWrapper(config, k8sRequestProvider.IncKubernetesRequest) + kubeClient, err := kubernetes.NewForConfig(config) checkError(err) argoprojClient, err := clientset.NewForConfig(config) @@ -155,8 +158,6 @@ func newCommand() *cobra.Command { configMapInformer := controllerNamespaceInformerFactory.Core().V1().ConfigMaps() secretInformer := controllerNamespaceInformerFactory.Core().V1().Secrets() - k8sRequestProvider := &metrics.K8sRequestsCountProvider{} - kubeclientmetrics.AddMetricsTransportWrapper(config, k8sRequestProvider.IncKubernetesRequest) mode, err := ingressutil.DetermineIngressMode(ingressVersion, kubeClient.DiscoveryClient) checkError(err) ingressWrapper, err := ingressutil.NewIngressWrapper(mode, kubeClient, kubeInformerFactory) diff --git a/controller/metrics/client.go b/controller/metrics/client.go index f2e2624d20..01367745ef 100644 --- a/controller/metrics/client.go +++ b/controller/metrics/client.go @@ -35,7 +35,8 @@ func (m *K8sRequestsCountProvider) IncKubernetesRequest(resourceInfo kubeclientm name = "Unknown" kind = "Unknown" } - - m.k8sRequestsCount.WithLabelValues(kind, namespace, name, string(resourceInfo.Verb), statusCode).Inc() + if m.k8sRequestsCount != nil { + m.k8sRequestsCount.WithLabelValues(kind, namespace, name, string(resourceInfo.Verb), statusCode).Inc() + } return nil }