I didn't see that you had already added the check for metric name. Looks good, but lets give more info to user in the error message about what a valid metric / section name should be.