prometheus_exporter icon indicating copy to clipboard operation
prometheus_exporter copied to clipboard

Allow taking the update lock without waiting

Open robryk opened this issue 2 years ago • 2 comments

wait_request and wait_duration can be used to achieve two results at once:

  • on demand/periodic metric generation,
  • synchronization of metric updates, so that we never publish a set of metrics whose values do not agree with each other.

I would like to do the latter without the former: my metrics are updates based on events, but those events cause updates of multiple metrics. wait_duration with a zero duration would probably do what I want, but it's unintuitive.

robryk avatar Jan 05 '23 23:01 robryk

@robryk Should be easy to implement. Do you have a preference for a name for this new method. Just calling it wait would be ok I think.

AlexanderThaller avatar Jan 12 '23 08:01 AlexanderThaller

https://github.com/AlexanderThaller/prometheus_exporter/pull/41 does that work for you? @robryk

AlexanderThaller avatar Jan 12 '23 09:01 AlexanderThaller