Skip to content

Commit 19ab8a8

Browse files
committed
add new feature flags for adjusting prometheus labeling handling
1 parent 217e11a commit 19ab8a8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

prometheus/querier.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@ package prometheus
66
import (
77
"context"
88
"fmt"
9-
"github.com/prometheus/prometheus/util/annotations"
109
"strings"
1110
"time"
1211

13-
"github.com/prometheus/prometheus/model/labels"
14-
"github.com/prometheus/prometheus/storage"
15-
1612
"github.com/lomik/graphite-clickhouse/config"
1713
"github.com/lomik/graphite-clickhouse/finder"
1814
"github.com/lomik/graphite-clickhouse/helper/clickhouse"
1915
"github.com/lomik/graphite-clickhouse/pkg/scope"
2016
"github.com/lomik/graphite-clickhouse/pkg/where"
2117
"github.com/prometheus/prometheus/model/labels"
18+
"github.com/prometheus/prometheus/util/annotations"
2219
)
2320

2421
// Querier provides reading access to time series data.
@@ -50,7 +47,7 @@ func (q *Querier) LabelValues(ctx context.Context, label string, matchers ...*la
5047
}
5148
terms = append(terms, matcherTerms...)
5249

53-
w, _, err := finder.TaggedWhere(terms)
50+
w, _, err := finder.TaggedWhere(terms, q.config.FeatureFlags.UseCarbonBehavior, q.config.FeatureFlags.DontMatchMissingTags)
5451
if err != nil {
5552
return nil, nil, err
5653
}
@@ -95,7 +92,7 @@ func (q *Querier) LabelNames(ctx context.Context, matchers ...*labels.Matcher) (
9592
w := where.New()
9693
// @TODO: this is duplicate to the for in finder.TaggedWhere. (different start...)
9794
for i := 0; i < len(terms); i++ {
98-
and, err := finder.TaggedTermWhereN(&terms[i])
95+
and, err := finder.TaggedTermWhereN(&terms[i], q.config.FeatureFlags.UseCarbonBehavior, q.config.FeatureFlags.DontMatchMissingTags)
9996
if err != nil {
10097
return nil, nil, err
10198
}

0 commit comments

Comments
 (0)