Github user srdo commented on the issue:
https://github.com/apache/storm/pull/2714
It might be good to consider whether we could move away from `static` for
metrics, and consider if we could do dependency injection instead? The cause of
the issue you mention on JIRA (accidentally loading metrics) seems to me to be
because the metrics registration is `static`.
We're already kind of using StormMetricsRegistry/StormMetricRegistry as if
they belong to the daemon classes, because the daemons are responsible for
calling `start`/`stop` on them.
I think for many of the daemons (e.g. Nimbus, Supervisor, DRPCServer), we
could probably instantiate a StormMetricsRegistry in the main method or main
class constructor, and pass that down to any other classes that need it. That
way we could move metrics registration to be non-static, so we don't run into
this kind of problem.
What do you think @zd-project?
---