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

Change --log.level=info to --log.level=warn in Dockerfile #3386

Closed
dsvensson opened this Issue Nov 1, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@dsvensson
Copy link

dsvensson commented Nov 1, 2017

What did you do?

Started prometheus under docker-compose.

What did you expect to see?

Nothing.

What did you see instead? Under which circumstances?

Lots of log INFO's that I want to hide.

Environment

prom/prometheus docker container.

  • System information:

    docker

  • Prometheus version:

    2.0.0-rc2

  • Logs:

prometheus_1  | level=info ts=2017-11-01T09:39:34.401732653Z caller=main.go:215 msg="Starting Prometheus" version="(version=2.0.0-rc.2, branch=master, revision=3701a827cf5da595bd2366dad6e1b3c979a1009c)"
prometheus_1  | level=info ts=2017-11-01T09:39:34.40179053Z caller=main.go:216 build_context="(go=go1.9.2, user=root@78a874392a56, date=20171031-19:21:13)"
prometheus_1  | level=info ts=2017-11-01T09:39:34.401811123Z caller=main.go:217 host_details="(Linux 4.9.49-moby #1 SMP Wed Sep 27 23:17:17 UTC 2017 x86_64 47b7422941a8 (none))"
prometheus_1  | level=info ts=2017-11-01T09:39:34.404592868Z caller=web.go:380 component=web msg="Start listening for connections" address=0.0.0.0:9090
prometheus_1  | level=info ts=2017-11-01T09:39:34.404612563Z caller=targetmanager.go:69 component="target manager" msg="Starting target manager..."
prometheus_1  | level=info ts=2017-11-01T09:39:34.404599197Z caller=main.go:314 msg="Starting TSDB"
prometheus_1  | level=info ts=2017-11-01T09:39:34.613745929Z caller=main.go:326 msg="TSDB started"
prometheus_1  | level=info ts=2017-11-01T09:39:34.613846488Z caller=main.go:394 msg="Loading configuration file" filename=/etc/prometheus/prometheus.yml
prometheus_1  | level=info ts=2017-11-01T09:39:34.617933193Z caller=main.go:371 msg="Server is ready to receive requests."

Final attempt. As there are good arguments for not controlling log level via configuration (#3384), and opinionated reasons for not giving docker-compose control over the command line arguments in the upstream prom/prometheus container (#3385), then perhaps the Dockerfile log level can be changed to warn under the flag of Basics of the Unix Philosophy:

  1. Rule of Silence: When a program has nothing surprising to say, it should say nothing.
@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Nov 1, 2017

It's good for applications to be verbose at startup, as it's a great aid with debugging issues then. The startup information is all quite important for us when dealing with user support requests and thus info should remain the default.

The logs here are extremely light as startup logs go, though there's some work in progress to expand them a bit.

@dsvensson

This comment has been minimized.

Copy link
Author

dsvensson commented Nov 1, 2017

But don't they fall under 'surprising'? If the intention is that things should start, what is the value of having the lines say that everything went as intended? I expect an error would be printed otherwise?

Having Prometheus version logged is ofc interesting, and it might also be valuable to list host details. But it does seem fairly verbose.

prometheus_1  | level=info ts=2017-11-01T09:39:34.404592868Z caller=web.go:380 component=web msg="Start listening for connections" address=0.0.0.0:9090

Should be an error message if that doesn't succeed?

prometheus_1  | level=info ts=2017-11-01T09:39:34.404612563Z caller=targetmanager.go:69 component="target manager" msg="Starting target manager..."

Failed to start target manager?

prometheus_1  | level=info ts=2017-11-01T09:39:34.404599197Z caller=main.go:314 msg="Starting TSDB"
prometheus_1  | level=info ts=2017-11-01T09:39:34.613745929Z caller=main.go:326 msg="TSDB started"

Failed to start TSDB?

prometheus_1  | level=info ts=2017-11-01T09:39:34.613846488Z caller=main.go:394 msg="Loading configuration file" filename=/etc/prometheus/prometheus.yml

Error if config could not be read, othewise it loads what the user requested, or what --help says is default.

prometheus_1  | level=info ts=2017-11-01T09:39:34.617933193Z caller=main.go:371 msg="Server is ready to receive requests."

Server startup failed

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Nov 1, 2017

If the intention is that things should start, what is the value of having the lines say that everything went as intended?

So we can tell where things got stuck.

@dsvensson

This comment has been minimized.

Copy link
Author

dsvensson commented Nov 1, 2017

So the main reason for these INFO logs being the default everywhere is to be able to debug Prometheus when it hangs, in situations where it does not hang during startup if restarting with --log.level=debug? Not saying it's bad, just want to understand the reason.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Nov 1, 2017

Info is generally the default for logging. These log lines are info so we can debug hangs, as getting users to change log levels (especially for rarely occurring issues) can be difficult.

@dsvensson

This comment has been minimized.

Copy link
Author

dsvensson commented Nov 1, 2017

Yeah, I know, changing log levels does lack some usability ;)

@dsvensson dsvensson closed this Nov 1, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.