metrics: deal with app and host names with a `.`

Do not allow dots in our app or host name substitutions, they mess up
the statsd metrics hierarchy, which uses `.` as a separator.