I’d like to announce a library for dynamic management of Go flags.
It implements thread-safe flags that can be modified at run-time, hooking into the widely adopted pflags. It implements the dynamic management of Go flags through etcd, allowing for runtime modification of their values in a consistent fashion across multiple instances of the Go binary. This enables:
- changing tuning parameters, e.g. RPC timeouts
- building rich config files (using DynJSON) that drive complex behaviour of servers, e.g. rate-limiting configuration
- easy inspection of the Go server’s flag configuration using a /debug/flagz Handler.
The concept isn’t new, as Google’s datacenter technology papers mention dynamic reconfiguration services. This is the first step towards achieving that in open-source.
We’ve been using this library in production at Improbable for a few months now, enabling a “restart-free” operational experience.
Comments, PRs and bug reports welcome
Head of Infrastructure