From 95cb339574a00b87b0b0cee7ae9717b50446e399 Mon Sep 17 00:00:00 2001 From: Andrew Baptist Date: Fri, 13 Sep 2024 20:18:52 +0000 Subject: [PATCH] util: publish cidr metrics for tenants Previously the cidr metrics were only started for the system tenant. This was problematic for SQL tenants since the mapping wouldn't be updated. Fixes: #130708 Release note: None --- pkg/server/tenant.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/server/tenant.go b/pkg/server/tenant.go index a06619e825e2..b751edc83afc 100644 --- a/pkg/server/tenant.go +++ b/pkg/server/tenant.go @@ -420,6 +420,13 @@ func newTenantServer( } } + // NB: On a shared process tenant, we start cidr once per tenant. + // Potentially we could share this across tenants, but this breaks the + // tenant separation model. For a small number of tenants this is OK, but if + // we have a large number of tenants in shared process mode this could be a + // problem from a memory and network perspective. + baseCfg.CidrLookup.Start(ctx, stopper) + // Instantiate the SQL server proper. sqlServer, err := newSQLServer(ctx, args) if err != nil {