Open bbengfort opened 4 years ago
Update: we've added a SuppressMetrics
flag to the config that the server respects, e.g. if the radish service listens and SuppressMetrics
is false
then the server registers the metrics (returning an error) and serves them in their own goroutine; if true
, the server does nothing.
This is better, but still leaves questions:
We'd like the prometheus metrics to be flexible to our library users. E.g. we don't want to panic with
prometheus.MustRegister
and give the user some ability to control the registration of the metrics.Potentially we should add a
sync.Once
around the register metrics call, and keep track if the registration has occurred using an internal flag. Then when we actually use the metrics we can check the flag to ensure they've been registered or do nothing if they haven't been. The question is what happens if we call the metrics without registering, is it just a noop or do they panic? (My hypothesis is that it's just a noop but we need to test this).See #11