Keep the same metric-name validation with prometheus-client before 0.22.
The dependency is deliberately unversioned in the ebuild.

--- a/mqtt_exporter/main.py
+++ b/mqtt_exporter/main.py
@@ -21,8 +21,13 @@
     Gauge,
     generate_latest,
     start_http_server,
-    validation,
 )
+
+# prometheus-client moved the legacy-name expression in 0.22.
+try:
+    from prometheus_client.validation import METRIC_NAME_RE
+except ImportError:
+    from prometheus_client.metrics_core import METRIC_NAME_RE
 
 from mqtt_exporter import settings
 from mqtt_exporter.exceptions import MaximumMetricReached
@@ -191,7 +196,7 @@
 
     https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
     """
-    if validation.METRIC_NAME_RE.match(prom_metric_name):
+    if METRIC_NAME_RE.match(prom_metric_name):
         return prom_metric_name
 
     # clean invalid characters
