discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
525 stars 153 forks source link

FIX: ensure threads do not leak when #start is called #219

Closed SamSaffron closed 2 years ago

SamSaffron commented 2 years ago

Periodic instrumentation now follows a general pattern where they inherit from PeriodicStats.

This implementation ensures proper management of backing thread

  1. All classes inheriting now have a .started? method to determine if instrument is started

  2. All classes implement a clean .stop method for stopping active periodic instrumentation

  3. Consumers of the class get to write less code repeat code due to worker_loop

spiderpug commented 2 years ago

We're encountering this issue https://github.com/discourse/prometheus_exporter/issues/222 after upgrading to 2.0.1.

Our mitigation: rollback to 2.0.0