diff --git a/pkg/loki/loki.go b/pkg/loki/loki.go index 14c7290bfa94b..e20283b33696a 100644 --- a/pkg/loki/loki.go +++ b/pkg/loki/loki.go @@ -418,6 +418,7 @@ func (t *Loki) setupAuthMiddleware() { "/grpc.health.v1.Health/Check", "/grpc.health.v1.Health/Watch", "/metastorepb.MetastoreService/AddBlock", + "/metastorepb.MetastoreService/ListBlocksForQuery", "/logproto.StreamData/GetStreamRates", "/frontend.Frontend/Process", "/frontend.Frontend/NotifyClientShutdown", @@ -724,7 +725,7 @@ func (t *Loki) setupModuleManager() error { Store: {Overrides, IndexGatewayRing}, IngesterRF1: {Store, Server, MemberlistKV, TenantConfigs, MetastoreClient, Analytics}, Ingester: {Store, Server, MemberlistKV, TenantConfigs, Analytics}, - Querier: {Store, Ring, Server, IngesterQuerier, PatternRingClient, Overrides, Analytics, CacheGenerationLoader, QuerySchedulerRing}, + Querier: {Store, Ring, Server, IngesterQuerier, PatternRingClient, MetastoreClient, Overrides, Analytics, CacheGenerationLoader, QuerySchedulerRing}, QueryFrontendTripperware: {Server, Overrides, TenantConfigs}, QueryFrontend: {QueryFrontendTripperware, Analytics, CacheGenerationLoader, QuerySchedulerRing}, QueryScheduler: {Server, Overrides, MemberlistKV, Analytics, QuerySchedulerRing}, diff --git a/pkg/loki/modules.go b/pkg/loki/modules.go index d823f5cedb5cd..898249682b02d 100644 --- a/pkg/loki/modules.go +++ b/pkg/loki/modules.go @@ -1829,12 +1829,16 @@ func (t *Loki) initMetastore() (services.Service, error) { if err != nil { return nil, err } + // Service methods have tenant auth disabled in the fakeauth.SetupAuthMiddleware call since this is a shared service metastorepb.RegisterMetastoreServiceServer(t.Server.GRPC, m) return m, nil } func (t *Loki) initMetastoreClient() (services.Service, error) { + if !t.Cfg.IngesterRF1.Enabled && !t.Cfg.QuerierRF1.Enabled { + return nil, nil + } mc, err := metastoreclient.New(t.Cfg.MetastoreClient, prometheus.DefaultRegisterer) if err != nil { return nil, err