diff --git a/config/config.go b/config/config.go index 0cf69f7a3..31fd5c800 100644 --- a/config/config.go +++ b/config/config.go @@ -117,7 +117,7 @@ type Common struct { } type FeatureFlags struct { - UseCarbonBehavior bool `toml:"use-carbon-behaviour" json:"use-carbon-behaviour" comment:"if true, in cases where the behaivior is mutually exclusive, gch will treat tags the same way as carbon does"` + UseCarbonBehavior bool `toml:"use-carbon-behaviour" json:"use-carbon-behaviour" comment:"if true, prefers carbon's behaviour on how tags are treated"` DontMatchMissingTags bool `toml:"dont-match-missing-tags" json:"dont-match-missing-tags" comment:"if true, seriesByTag requests containing 'not equal' terms will not match metrics that don't have the tag at all"` } diff --git a/doc/config.md b/doc/config.md index da1734b58..c8de4562d 100644 --- a/doc/config.md +++ b/doc/config.md @@ -224,6 +224,12 @@ Only one tag used as filter for index field Tag1, see graphite_tagged table [str # offset beetween now and until for select short cache timeout short-offset = 0 +[feature-flags] + # if true, prefers carbon's behaviour on how tags are treated + use-carbon-behaviour = false + # if true, seriesByTag requests containing 'not equal' terms will not match metrics that don't have the tag at all + dont-match-missing-tags = false + [metrics] # graphite relay address metric-endpoint = "" diff --git a/graphite-clickhouse.go b/graphite-clickhouse.go index f8a3d7fe1..2a218ae9e 100644 --- a/graphite-clickhouse.go +++ b/graphite-clickhouse.go @@ -81,13 +81,6 @@ func (app *App) Handler(handler http.Handler) http.Handler { w.Header().Add("X-Gch-Request-ID", scope.RequestID(r.Context())) - var featFlagsContext context.Context - // if app.config.FeatureFlags.UseCarbonBehavior { - featFlagsContext = scope.With(r.Context(), "use-carbon-behaviour", true) - // } - - r = r.WithContext(featFlagsContext) - handler.ServeHTTP(writer, r) }) } diff --git a/pkg/scope/key.go b/pkg/scope/key.go index 4f40af3b7..fa442dac1 100644 --- a/pkg/scope/key.go +++ b/pkg/scope/key.go @@ -67,8 +67,3 @@ func ClickhouseUserAgent(ctx context.Context) string { } return fmt.Sprintf("Graphite-Clickhouse/%s (table:%s)", Version, Table(ctx)) } - -// UseCarbonBehavior ... -func UseCarbonBehavior(ctx context.Context) bool { - return Bool(ctx, "use-carbon-behaviour") -}