From 6a464ae174f74808cbcc7fe0dec97dbbec3b2847 Mon Sep 17 00:00:00 2001 From: Harsh Agarwal Date: Sun, 22 Jul 2018 16:11:38 +0530 Subject: [PATCH] expose log.level for promlog for remote_storage_adapter (#4195) * expose log.level for promlog for remote_storage_adapter Signed-off-by: sipian * replace flag description Signed-off-by: Harsh Agarwal --- .../examples/remote_storage/remote_storage_adapter/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/examples/remote_storage/remote_storage_adapter/main.go b/documentation/examples/remote_storage/remote_storage_adapter/main.go index e6e19889f..d2c83d5b9 100644 --- a/documentation/examples/remote_storage/remote_storage_adapter/main.go +++ b/documentation/examples/remote_storage/remote_storage_adapter/main.go @@ -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()