util/promlint/promlint.go
func lintMetricUnits(mf dto.MetricFamily) []Problem {
	var problems problems

	unit, base, ok := metricUnits(*mf.Name)
	if !ok {
		// No known units detected.
		return nil
	}

	// Unit is already a base unit.
	if unit == base {
		return nil
	}

	problems.Add(mf, fmt.Sprintf("use base unit %q instead of %q", base, unit))

	return problems
}
func lintMetricUnits(mf dto.MetricFamily) []Problem {
	var problems problems

	unit, base, ok := metricUnits(*mf.Name)
	if !ok {
		// No known units detected.
		return nil
	}

	// Unit is already a base unit.
	if unit == base {
		return nil
	}

	problems.Add(mf, fmt.Sprintf("use base unit %q instead of %q", base, unit))

	return problems
}
// lintMetricUnits detects issues with metric unit names.