end to end example of creating metrics dynamically