From c6b51f090a35415d22dc694e97bc88897379e92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 7 Jun 2023 17:17:16 +0200 Subject: [PATCH] cleanup --- c2cwsgiutils/scripts/stats_db.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/c2cwsgiutils/scripts/stats_db.py b/c2cwsgiutils/scripts/stats_db.py index dae1dade6..56d2a6b49 100755 --- a/c2cwsgiutils/scripts/stats_db.py +++ b/c2cwsgiutils/scripts/stats_db.py @@ -82,13 +82,11 @@ def get_gauge(self, kind: str, kind_help: str, labels: List[str]) -> Gauge: return self.gauges[kind] def do_report( - self, metric: List[str], value: int, kind: str, kind_help: str, tags: Optional[Dict[str, str]] = None + self, metric: List[str], value: int, kind: str, kind_help: str, tags: Dict[str, str] ) -> None: LOG.debug("%s.%s -> %d", kind, ".".join(metric), value) - if value > 0: # Don't export 0 values. We can always set null=0 in grafana... - tags = {**(tags or {}), **stats.get_env_tags()} - gauge = self.get_gauge(kind, kind_help, list(tags.keys())) - gauge.labels(**tags).set(value) + gauge = self.get_gauge(kind, kind_help, list(tags.keys())) + gauge.labels(**tags).set(value) def commit(self) -> None: if self.prometheus_push: