Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3186 from matrix-org/erikj/fix_int_values_metrics
Browse files Browse the repository at this point in the history
Fix metrics that have integer value labels
  • Loading branch information
erikjohnston authored May 8, 2018
2 parents 966686c + 6d8ec34 commit 0b7dfbb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions synapse/metrics/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def _render_for_labels(self, label_values, value):
"""Render this metric for a single set of labels
Args:
label_values (list[str]): values for each of the labels
label_values (list[object]): values for each of the labels,
(which get stringified).
value: value of the metric at with these labels
Returns:
Expand Down Expand Up @@ -324,4 +325,4 @@ def _escape_character(m):
def _escape_label_value(value):
"""Takes a label value and escapes quotes, newlines and backslashes
"""
return re.sub(r"([\n\"\\])", _escape_character, value)
return re.sub(r"([\n\"\\])", _escape_character, str(value))

0 comments on commit 0b7dfbb

Please sign in to comment.