Fix pattern match on metrics containing slashes.