expose log.level for promlog for remote_storage_adapter (#4195)

* expose log.level for promlog for remote_storage_adapter

Signed-off-by: sipian <cs15btech11019@iith.ac.in>

* replace flag description

Signed-off-by: Harsh Agarwal <cs15btech11019@iith.ac.in>
This commit is contained in:
Harsh Agarwal 2018-07-22 16:11:38 +05:30 committed by Goutham Veeramachaneni
parent c016b63219
commit 6a464ae174
1 changed files with 3 additions and 2 deletions

View File

@ -54,6 +54,7 @@ type config struct {
remoteTimeout time.Duration
listenAddr string
telemetryPath string
logLevel string
}
var (
@ -99,8 +100,7 @@ func main() {
http.Handle(cfg.telemetryPath, prometheus.Handler())
logLevel := promlog.AllowedLevel{}
logLevel.Set("debug")
logLevel.Set(cfg.logLevel)
logger := promlog.New(logLevel)
writers, readers := buildClients(logger, cfg)
@ -141,6 +141,7 @@ func parseFlags() *config {
)
flag.StringVar(&cfg.listenAddr, "web.listen-address", ":9201", "Address to listen on for web endpoints.")
flag.StringVar(&cfg.telemetryPath, "web.telemetry-path", "/metrics", "Address to listen on for web endpoints.")
flag.StringVar(&cfg.logLevel, "log.level", "debug", "Only log messages with the given severity or above. One of: [debug, info, warn, error]")
flag.Parse()