janusgraph icon indicating copy to clipboard operation
janusgraph copied to clipboard

Update Dropwizard Metrics to 4.2

Open FlorianHockmann opened this issue 3 years ago • 1 comments

We're currently using version 4.1 of this library for metrics. The update to 4.2 seems to be problematic as it leads to errors due to some problem where a metric is created again with the same name:

Caused by: org.janusgraph.diskstorage.PermanentBackendException: Couldn't initialize CQLStoreManager
Caused by: java.lang.IllegalArgumentException: A metric named org.janusgraph.threadpools.CqlStoreManager.executorService.pool.size already exists

That is why Dependabot now ignores this minor version (see #3091). So, we have to make the update ourselves.

FlorianHockmann avatar Jul 06 '22 15:07 FlorianHockmann

An IllegalArgumentException is raised when a metric is registered twice. This only applies to metrics added using the register method.

A number of new metrics were added to the InstrumentedExecutorService in dropwizard/metrics 4.2.10.

Before: https://github.com/dropwizard/metrics/blob/v4.1.18/metrics-core/src/main/java/com/codahale/metrics/InstrumentedExecutorService.java#L48-L55 After: https://github.com/dropwizard/metrics/blob/v4.2.10/metrics-core/src/main/java/com/codahale/metrics/InstrumentedExecutorService.java#L51-L87

And pool.size is one of them.

Next step is to understand why the metrics are registered twice.

Also, as we already had the tasks.queued metric in janusgraph under the name queueSize, we should remove it once we've upgraded to 4.2.10 and make a note of it in the documentation.

cdegroc avatar Jul 08 '22 14:07 cdegroc

Fixed by #3213

farodin91 avatar Sep 26 '22 11:09 farodin91