brigadecore / brigade

Event-driven scripting for Kubernetes
https://brigade.sh/
Apache License 2.0
2.4k stars 247 forks source link

components should dump important configuration to the logs at startup #1918

Closed krancour closed 2 years ago

krancour commented 2 years ago

As I start my efforts to diagnose some outstanding bugs, I'm finding this would be extremely useful. It would be great to know when a component is perhaps not configured the way you thought it was.

Let's apply this to the apiserver, scheduler, and observer components for now.

Great care should be taken to only display non-sensitive configuration -- no secretes.

AnuragThePathak commented 2 years ago

Should it be left for newbies or we can work as well?

krancour commented 2 years ago

Anyone. You want to tackle this @AnuragThePathak?

This should be relatively simple... maybe add a new function to each component's main.go that nicely formats the various config objects and that should do the trick.

AnuragThePathak commented 2 years ago

Anyone. You want to tackle this @AnuragThePathak?

Actually I was looking for something to work on but among the recently created issues only the instrumentation one involving prometheus was neither assigned to anyone nor labeled as good-first-issue. But I am willing to learn prometheus now as I'm having college exams soon and I'm under-prepared for it. So interested in working with it if it's open for anyone.

krancour commented 2 years ago

@AnuragThePathak no one is restricted from taking issues that aren't labeled as good first issue. Those labels are just to help folks who are really new find easy issues to get started with.

I'll warn you, however, that the issue involving Prometheus is probably on the "very advanced" end of the spectrum. But please to try it if you feel confident!

AnuragThePathak commented 2 years ago

Are usernames considered as sensitive data? For example username in ReaderFactoryConfig?

krancour commented 2 years ago

I wouldn't say so, but I also am not sure that's a bit of info that will help much with troubleshooting. We want to focus on the things that will really help us to sort out problems faster. Probably the most interesting bits of information would be options that the operator who installed Brigade selected such as limits to concurrency, refresh intervals -- things of this nature.

It was actually #1917 that inspired this issue because it would be convenient when troubleshooting an issue such as that one to be able to verify that the setting is what I think it is. It helps distinguish between "something is wrong because the setting wasn't picked up correctly" and "something is wrong because the setting was picked up, but there's a bug that isn't honoring the setting."

AnuragThePathak commented 2 years ago

Makes sense.