ekg icon indicating copy to clipboard operation
ekg copied to clipboard

Fail to restart monitoring server with the same Store

Open denisshevchenko opened this issue 2 years ago • 0 comments

When I run System.Remote.Monitoring.forkServerWith function the first time - it works perfectly. But if I killed the server explicitly (using serverThreadId) and then try to start it again with the same Store, the server cannot be launched because of an exception:

The name ""ekg.server_timestamp_ms"" is already taken by a metric.
CallStack (from HasCallStack):
  error, called at ./System/Metrics.hs:214:5 in ekg-core-0.1.1.7-6wBeq6DHUUjI67QEVzudFR:System.Metrics

This is the first line in forkServerWith function:

Metrics.registerCounter "ekg.server_timestamp_ms" getTimeMs store

Unfortunately, there is no way to "unregister" this Counter before restarting of the server. So, what can I do?

denisshevchenko avatar Nov 25 '21 14:11 denisshevchenko