Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mchrome committed Mar 11, 2024
1 parent a5d354a commit ab4a665
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
6 changes: 6 additions & 0 deletions doc/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
7 changes: 0 additions & 7 deletions graphite-clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/scope/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit ab4a665

Please sign in to comment.