Sanitize metric names to avoid API errors