Metric geometry of the Grushin plane and generalizations