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

How to get Kubernetes log messages from inside Prometheus? #3236

Open
bboreham opened this Issue Oct 3, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@bboreham
Copy link
Contributor

bboreham commented Oct 3, 2017

prometheus/discovery/kubernetes calls Kubernetes code; Kubernetes code logs via glog; there doesn't seem to be a way to set the glog level inside Prometheus.

glog does set up command-line options like -v via flag.Var(), but because nobody is calling flag.Parse() they don't help.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Oct 3, 2017

In the 2.0 branch we are overwriting the error handler and handle the logging of errors from the k8s code base ourselves: https://github.com/prometheus/prometheus/blob/dev-2.0/cmd/prometheus/main.go#L205-L212

@bboreham

This comment has been minimized.

Copy link
Contributor Author

bboreham commented Oct 3, 2017

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Oct 3, 2017

I see, ultimately, this is a severe mis-design of Kubernetes libraries in general and we currently don't and cannot provide flags for a basically arbitrarily chosen and unswappable logging libraryies somewhere in our dependencies.

Why are you interested in seeing those debug logs?

@bboreham

This comment has been minimized.

Copy link
Contributor Author

bboreham commented Oct 3, 2017

Got an error from discovery; didn't understand it; wanted more context what the k8s library was doing.

More specifically it was a customer running the program so I preferred to say "run with -v=8 and send me the full log" - even though most of the information is useless it is good to get it all in one hit rather than go back 20 times "ok, now try this...".

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Oct 3, 2017

Yes, that's right. It would be great to just show those messages when debug logging is enabled but with k8s' current approach I don't see a sane way for us to do it =/

@bboreham

This comment has been minimized.

Copy link
Contributor Author

bboreham commented Mar 14, 2018

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