Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take 2 for fix the limit settings #519

Merged
merged 2 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/loki/loki-local-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ storage_config:

filesystem:
directory: /tmp/loki/chunks

limits_config:
enforce_metric_name: false
11 changes: 9 additions & 2 deletions cmd/loki/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/cortexproject/cortex/pkg/util"
"github.com/cortexproject/cortex/pkg/util/flagext"
"github.com/cortexproject/cortex/pkg/util/validation"
)

func init() {
Expand All @@ -29,8 +30,14 @@ func main() {
flagext.RegisterFlags(&cfg)
flag.Parse()

// The flags set the EnforceMetricName to be true, but in loki it _should_ be false.
cfg.LimitsConfig.EnforceMetricName = false
// LimitsConfig has a customer UnmarshalYAML that will set the defaults to a global.
// This global is set to the config passed into the last call to `NewOverrides`. If we don't
// call it atleast once, the defaults are set to an empty struct.
// We call it with the flag values so that the config file unmarshalling only overrides the values set in the config.
if _, err := validation.NewOverrides(cfg.LimitsConfig); err != nil {
level.Error(util.Logger).Log("msg", "error loading limits", "err", err)
os.Exit(1)
}

util.InitLogger(&cfg.Server)

Expand Down
2 changes: 2 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ config:
# prefix: ""
# httpclienttimeout: "20s"
# consistentreads: true
limits_config:
enforce_metric_name: false
schema_config:
configs:
- from: 0
Expand Down
4 changes: 4 additions & 0 deletions production/ksonnet/loki/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
grpc_server_max_recv_msg_size: 1024 * 1024 * 64,
},

limits_config: {
enforce_metric_name: false,
},

ingester: {
chunk_idle_period: '15m',

Expand Down