Netflix/Hystrix — pull request #360 by nsowen (2014-12-15 11:09:31+00:00)
Title: Metrics expire after inactivity in milliseconds

I have quite a number of commands which get created dynamically, therefore the dashboards gets kind of crowded after a few days and we end up calling Hystrix.reset().

Therefore I think it's worth being able to define a "last touch" timestamp within each HystrixCommandMetrics instance and a new optional configuration option for each Command that defines a expire-timeout on per-command basis. Proposed option for expiring metrics automatically after one day:

hystrix.command.default.metrics.expireAfterInactivityInMilliseconds=86400000

Same option for a specific command:

hystrix.command.[CommandKey].metrics.expireAfterInactivityInMilliseconds=86400000

Maybe it is worth discussing the additional CPU cycles required for touch() and expire() in class HystricCommandMetrics.

Another caveat: existing AJAX-connections with HystrixMetricsStreamServlet will not be updated automatically because its internal LinkedBlockedQueue used holds up to 1000 JSON entries, so also those expired metrics.