Dynamically get metrics from your Java application