Skip to content

Commit

Permalink
add new feature flags for adjusting prometheus labeling handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedius committed May 24, 2024
1 parent 217e11a commit 19ab8a8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions prometheus/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ package prometheus
import (
"context"
"fmt"
"github.com/prometheus/prometheus/util/annotations"
"strings"
"time"

"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/storage"

"github.com/lomik/graphite-clickhouse/config"
"github.com/lomik/graphite-clickhouse/finder"
"github.com/lomik/graphite-clickhouse/helper/clickhouse"
"github.com/lomik/graphite-clickhouse/pkg/scope"
"github.com/lomik/graphite-clickhouse/pkg/where"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/util/annotations"
)

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

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

0 comments on commit 19ab8a8

Please sign in to comment.