mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-28 23:19:41 -08:00
require both a feature flag and a globalconfig flag
This commit is contained in:
parent
644e4c273c
commit
41224d66e5
|
@ -216,9 +216,8 @@ func (c *flagConfig) setFeatureListOptions(logger log.Logger) error {
|
||||||
config.DefaultGlobalConfig.ScrapeProtocols = config.DefaultProtoFirstScrapeProtocols
|
config.DefaultGlobalConfig.ScrapeProtocols = config.DefaultProtoFirstScrapeProtocols
|
||||||
level.Info(logger).Log("msg", "Experimental created timestamp zero ingestion enabled. Changed default scrape_protocols to prefer PrometheusProto format.", "global.scrape_protocols", fmt.Sprintf("%v", config.DefaultGlobalConfig.ScrapeProtocols))
|
level.Info(logger).Log("msg", "Experimental created timestamp zero ingestion enabled. Changed default scrape_protocols to prefer PrometheusProto format.", "global.scrape_protocols", fmt.Sprintf("%v", config.DefaultGlobalConfig.ScrapeProtocols))
|
||||||
case "utf8-names":
|
case "utf8-names":
|
||||||
config.DefaultConfig.GlobalConfig.AllowUTF8Names = true
|
|
||||||
config.DefaultGlobalConfig.AllowUTF8Names = true
|
|
||||||
model.NameValidationScheme = model.UTF8Validation
|
model.NameValidationScheme = model.UTF8Validation
|
||||||
|
level.Info(logger).Log("msg", "Experimental utf8 support enabled")
|
||||||
case "":
|
case "":
|
||||||
continue
|
continue
|
||||||
case "promql-at-modifier", "promql-negative-offset":
|
case "promql-at-modifier", "promql-negative-offset":
|
||||||
|
|
|
@ -731,6 +731,9 @@ func (c *ScrapeConfig) Validate(globalConfig GlobalConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if globalConfig.AllowUTF8Names {
|
if globalConfig.AllowUTF8Names {
|
||||||
|
if model.NameValidationScheme != model.UTF8Validation {
|
||||||
|
return fmt.Errorf("utf8 name support requested but feature not enabled via --enable-feature=utf8-names")
|
||||||
|
}
|
||||||
c.AllowUTF8Names = true
|
c.AllowUTF8Names = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue