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

Fix metrics that have integer value labels #3186

Merged
merged 2 commits into from
May 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))