google/cloudprober

Allow debugging configuration templates, and playbook

cool-RR opened this issue · 3 comments

This is a need I've had a few weeks ago, and now my teammate @maayanch has the same need as well.

We have a Cloudprober configuration template that may have different variables, different regular expressions that we match, etc. Sometimes it doesn't match the machines we think it should be matching. We want to understand how to debug it so we wouldn't have to do trial-and-error in the dark. We want visibility into all the variables. We want to be able to print stuff and see the output.

Are these things currently possible? If so, there should be a playbook or a documentation page that shows the different ways to debug Cloudprober configuration templates.

There is a "--dumpconfig" flag to dump the parsed config. Parsed config is also available at http://cloudprober-host:9313/config. I guess you want to dump all the variables too, which cloudprober sort of does, though not directly. Cloudprober uses sysvars while parsing the config[1], and sysvars are exported just like any other metric (you can see them at stdout through default file surfacer, /metrics URL, or logs (--logtostderr)).

[1] -

text, err := config.ParseTemplate(getConfig(), sysvars.Vars())

Thank you. I've never started Cloudprober manually, how do I get it to use this flag?

@cool-RR, Please see the announcement here: #679. Active development of this repository will move to github.com/cloudprober/cloudprober. Unfortunately, we'll have to close all the issues here, and file them again.