diff --git a/pkg/loki/modules.go b/pkg/loki/modules.go index 7b0e972516cc9..f85c7393432b5 100644 --- a/pkg/loki/modules.go +++ b/pkg/loki/modules.go @@ -608,9 +608,7 @@ func (t *Loki) initTableManager() (services.Service, error) { os.Exit(1) } - reg := prometheus.WrapRegistererWith(prometheus.Labels{"component": "table-manager-store"}, prometheus.DefaultRegisterer) - - tableClient, err := storage.NewTableClient(lastConfig.IndexType, *lastConfig, t.Cfg.StorageConfig, t.clientMetrics, reg, util_log.Logger) + tableClient, err := storage.NewTableClient("table-manager-store", lastConfig.IndexType, *lastConfig, t.Cfg.StorageConfig, t.clientMetrics, prometheus.DefaultRegisterer, util_log.Logger) if err != nil { return nil, err } diff --git a/pkg/storage/factory.go b/pkg/storage/factory.go index ed287e769645d..8f323e8691e70 100644 --- a/pkg/storage/factory.go +++ b/pkg/storage/factory.go @@ -584,7 +584,7 @@ func NewChunkClient(component, name string, cfg Config, schemaCfg config.SchemaC } // NewTableClient makes a new table client based on the configuration. -func NewTableClient(name string, periodCfg config.PeriodConfig, cfg Config, cm ClientMetrics, registerer prometheus.Registerer, logger log.Logger) (index.TableClient, error) { +func NewTableClient(component, name string, periodCfg config.PeriodConfig, cfg Config, cm ClientMetrics, registerer prometheus.Registerer, logger log.Logger) (index.TableClient, error) { switch true { case util.StringsContain(testingStorageTypes, name): switch name { @@ -593,7 +593,7 @@ func NewTableClient(name string, periodCfg config.PeriodConfig, cfg Config, cm C } case util.StringsContain(supportedIndexTypes, name): - objectClient, err := NewObjectClient("table", periodCfg.ObjectType, cfg, cm, registerer) + objectClient, err := NewObjectClient(component, periodCfg.ObjectType, cfg, cm, registerer) if err != nil { return nil, err }