From 1700a315c188e4b9d434d1e51de75426aa9d7867 Mon Sep 17 00:00:00 2001 From: Han Kang Date: Tue, 27 Aug 2019 10:30:57 -0700 Subject: [PATCH] add comment about explicitly registering grpcprom client metrics --- .../apiserver/pkg/storage/storagebackend/factory/etcd3.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go b/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go index eadb684f56c..f2e7452f4d2 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go @@ -48,6 +48,10 @@ const keepaliveTimeout = 10 * time.Second const dialTimeout = 20 * time.Second func init() { + // grpcprom auto-registers (via an init function) their client metrics, since we are opting out of + // using the global prometheus registry and using our own wrapped global registry, + // we need to explicitly register these metrics to our global registry here. + // For reference: https://github.com/kubernetes/kubernetes/pull/81387 legacyregistry.RawMustRegister(grpcprom.DefaultClientMetrics) }