expvarmon icon indicating copy to clipboard operation
expvarmon copied to clipboard

Allow keys to be specified using globs/pattern matching

Open zgramana opened this issue 10 years ago • 1 comments

We have some rather large and deeply nested expvars. As a user, I would love to use globs instead of commands like this:

./expvarmon -vars="cb.ops.Write(raw).count,cb.ops.Write(raw).p99,cb.ops.Write(raw).p95,cb.ops.Write(raw).p90,cb.ops.Write(raw).p75,cb.ops.Write(raw).p50,cb.ops.Write(raw).p25"

For example, it would be great to instead be able to simply type:

./expvarmon  -vars="cb.ops.Write(raw).*"

or even

./expvarmon  -vars="cb.ops.*"

zgramana avatar Oct 19 '15 18:10 zgramana

Hi Zachary. Current design is based on fixed list of vars names, UI is being constructed before vars are fetched. Refactoring to support wildcards is probably viable, but it adds a number of complications that should be addressed and solved right. UI should be (re)arranged on each json parse, service downtimes should be handled differenly (if UI depends on each JSON data blob), etc.

I'll think about it, but not promising a quick solution. Meanwhile, if you're up to solve this gracefully, PR is always welcome.

divan avatar Oct 29 '15 04:10 divan