@@ -153,7 +153,7 @@ func NewStore(cfg Config, storeCfg chunk.StoreConfig, schemaCfg chunk.SchemaConf
153
153
stores := chunk .NewCompositeStore (cacheGenNumLoader )
154
154
155
155
for _ , s := range schemaCfg .Configs {
156
- index , err := NewIndexClient (s .IndexType , cfg , schemaCfg )
156
+ index , err := NewIndexClient (s .IndexType , cfg , schemaCfg , s . From . String (), reg )
157
157
if err != nil {
158
158
return nil , errors .Wrap (err , "error creating index client" )
159
159
}
@@ -163,7 +163,7 @@ func NewStore(cfg Config, storeCfg chunk.StoreConfig, schemaCfg chunk.SchemaConf
163
163
if objectStoreType == "" {
164
164
objectStoreType = s .IndexType
165
165
}
166
- chunks , err := NewChunkClient (objectStoreType , cfg , schemaCfg )
166
+ chunks , err := NewChunkClient (objectStoreType , cfg , schemaCfg , s . From . String (), reg )
167
167
if err != nil {
168
168
return nil , errors .Wrap (err , "error creating object client" )
169
169
}
@@ -180,7 +180,7 @@ func NewStore(cfg Config, storeCfg chunk.StoreConfig, schemaCfg chunk.SchemaConf
180
180
}
181
181
182
182
// NewIndexClient makes a new index client of the desired type.
183
- func NewIndexClient (name string , cfg Config , schemaCfg chunk.SchemaConfig ) (chunk.IndexClient , error ) {
183
+ func NewIndexClient (name string , cfg Config , schemaCfg chunk.SchemaConfig , purpose string , registerer prometheus. Registerer ) (chunk.IndexClient , error ) {
184
184
if indexClientFactory , ok := customIndexStores [name ]; ok {
185
185
if indexClientFactory .indexClientFactoryFunc != nil {
186
186
return indexClientFactory .indexClientFactoryFunc ()
@@ -208,7 +208,7 @@ func NewIndexClient(name string, cfg Config, schemaCfg chunk.SchemaConfig) (chun
208
208
cfg .GCPStorageConfig .DistributeKeys = true
209
209
return gcp .NewStorageClientColumnKey (context .Background (), cfg .GCPStorageConfig , schemaCfg )
210
210
case "cassandra" :
211
- return cassandra .NewStorageClient (cfg .CassandraStorageConfig , schemaCfg )
211
+ return cassandra .NewStorageClient (cfg .CassandraStorageConfig , schemaCfg , purpose , registerer )
212
212
case "boltdb" :
213
213
return local .NewBoltDBIndexClient (cfg .BoltDBConfig )
214
214
case "grpc-store" :
@@ -219,7 +219,7 @@ func NewIndexClient(name string, cfg Config, schemaCfg chunk.SchemaConfig) (chun
219
219
}
220
220
221
221
// NewChunkClient makes a new chunk.Client of the desired types.
222
- func NewChunkClient (name string , cfg Config , schemaCfg chunk.SchemaConfig ) (chunk.Client , error ) {
222
+ func NewChunkClient (name string , cfg Config , schemaCfg chunk.SchemaConfig , purpose string , registerer prometheus. Registerer ) (chunk.Client , error ) {
223
223
switch name {
224
224
case "inmemory" :
225
225
return chunk .NewMockStorage (), nil
@@ -245,7 +245,7 @@ func NewChunkClient(name string, cfg Config, schemaCfg chunk.SchemaConfig) (chun
245
245
case "swift" :
246
246
return newChunkClientFromStore (openstack .NewSwiftObjectClient (cfg .Swift , chunk .DirDelim ))
247
247
case "cassandra" :
248
- return cassandra .NewObjectClient (cfg .CassandraStorageConfig , schemaCfg )
248
+ return cassandra .NewObjectClient (cfg .CassandraStorageConfig , schemaCfg , purpose , registerer )
249
249
case "filesystem" :
250
250
store , err := local .NewFSObjectClient (cfg .FSConfig )
251
251
if err != nil {
@@ -267,7 +267,7 @@ func newChunkClientFromStore(store chunk.ObjectClient, err error) (chunk.Client,
267
267
}
268
268
269
269
// NewTableClient makes a new table client based on the configuration.
270
- func NewTableClient (name string , cfg Config ) (chunk.TableClient , error ) {
270
+ func NewTableClient (name string , cfg Config , registerer prometheus. Registerer ) (chunk.TableClient , error ) {
271
271
if indexClientFactory , ok := customIndexStores [name ]; ok {
272
272
if indexClientFactory .tableClientFactoryFunc != nil {
273
273
return indexClientFactory .tableClientFactoryFunc ()
@@ -289,7 +289,7 @@ func NewTableClient(name string, cfg Config) (chunk.TableClient, error) {
289
289
case "gcp" , "gcp-columnkey" , "bigtable" , "bigtable-hashed" :
290
290
return gcp .NewTableClient (context .Background (), cfg .GCPStorageConfig )
291
291
case "cassandra" :
292
- return cassandra .NewTableClient (context .Background (), cfg .CassandraStorageConfig )
292
+ return cassandra .NewTableClient (context .Background (), cfg .CassandraStorageConfig , registerer )
293
293
case "boltdb" :
294
294
return local .NewTableClient (cfg .BoltDBConfig .Directory )
295
295
case "grpc-store" :
0 commit comments