Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Re-added clearing of CollectorRegistry on startup to prevent problems…
Browse files Browse the repository at this point in the history
… with registring exports when hot-reloading the app like when running Play via Sbt. Note that reloading does _not_ add the default exports since that class has an internal _initialized_ state which stays at _true_ when reloading classes preventing the exports to be added again.
  • Loading branch information
Joost den Boer committed Sep 13, 2018
1 parent f4610aa commit 2214abf
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class PrometheusModule extends Module {
import PrometheusModule._

override def bindings(environment: Environment, configuration: Configuration): Seq[Binding[_]] = {
CollectorRegistry.defaultRegistry.clear()

configuration.getOptional[Boolean](defaultExportsKey).foreach { enabled =>
if (enabled) {
DefaultExports.initialize()
Expand Down

0 comments on commit 2214abf

Please sign in to comment.