Maybe move this out into a JMX module so you can just call something like update_jmx_status(metrics_by_instance)