parent
8763dedb9d
commit
3abb2cc349
|
@ -68,9 +68,9 @@ func (q *querier) Close() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExternablLabelsHandler returns a storage.Queryable which creates a
|
// ExternalLabelsHandler returns a storage.Queryable which creates a
|
||||||
// externalLabelsQuerier.
|
// externalLabelsQuerier.
|
||||||
func ExternablLabelsHandler(next storage.Queryable, externalLabels model.LabelSet) storage.Queryable {
|
func ExternalLabelsHandler(next storage.Queryable, externalLabels model.LabelSet) storage.Queryable {
|
||||||
return storage.QueryableFunc(func(ctx context.Context, mint, maxt int64) (storage.Querier, error) {
|
return storage.QueryableFunc(func(ctx context.Context, mint, maxt int64) (storage.Querier, error) {
|
||||||
q, err := next.Querier(ctx, mint, maxt)
|
q, err := next.Querier(ctx, mint, maxt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -107,7 +107,7 @@ func (s *Storage) ApplyConfig(conf *config.Config) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
q := QueryableClient(c)
|
q := QueryableClient(c)
|
||||||
q = ExternablLabelsHandler(q, conf.GlobalConfig.ExternalLabels)
|
q = ExternalLabelsHandler(q, conf.GlobalConfig.ExternalLabels)
|
||||||
if len(rrConf.RequiredMatchers) > 0 {
|
if len(rrConf.RequiredMatchers) > 0 {
|
||||||
q = RequiredMatchersFilter(q, labelsToEqualityMatchers(rrConf.RequiredMatchers))
|
q = RequiredMatchersFilter(q, labelsToEqualityMatchers(rrConf.RequiredMatchers))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue