Skip to content

Commit 1fc8cc7

Browse files
authored
Merge pull request #457 from Adnuntius/jp_fix_prometheus_metrics
fix issue with prometheus
2 parents b48406c + 27648d1 commit 1fc8cc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pghoard/monitoring/prometheus.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def get_metrics(self):
3838
def _update(self, metric, value, tags):
3939
ts = str(int(time.time())) + "000"
4040

41-
metric = metric.replace(".", "_")
42-
tags = {**self._tags, **tags}
41+
metric = metric.replace(".", "_").replace("-", "_")
42+
tags = {**self._tags, **tags} if tags else {**self._tags}
4343
tag_list = []
4444
for k in sorted(tags.keys()):
4545
tag_list.append("{}=\"{}\"".format(k, tags[k]))

0 commit comments

Comments
 (0)