Skip to content
Snippets Groups Projects
Unverified Commit e2b25612 authored by Goutham Veeramachaneni's avatar Goutham Veeramachaneni Committed by GitHub
Browse files

Take 2 for fix the limit settings (#519)

* Revert "Make sure the default for EnforceMetricName is :white_check_mark:

 (#518)"

This reverts commit 199746a1.

* Fix overrides unmarshalling properly

Signed-off-by: default avatarGoutham Veeramachaneni <gouthamve@gmail.com>
parent 9440dc9c
No related branches found
No related tags found
No related merge requests found
......@@ -27,3 +27,6 @@ storage_config:
filesystem:
directory: /tmp/loki/chunks
limits_config:
enforce_metric_name: false
......@@ -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() {
......@@ -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)
......
......@@ -37,6 +37,8 @@ config:
# prefix: ""
# httpclienttimeout: "20s"
# consistentreads: true
limits_config:
enforce_metric_name: false
schema_config:
configs:
- from: 0
......
......@@ -29,6 +29,10 @@
grpc_server_max_recv_msg_size: 1024 * 1024 * 64,
},
limits_config: {
enforce_metric_name: false,
},
ingester: {
chunk_idle_period: '15m',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment