summary refs log tree commit diff
path: root/synapse/metrics/metric.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-05-08 09:48:50 +0100
committerGitHub <noreply@github.com>2018-05-08 09:48:50 +0100
commit0b7dfbb194018d22118a90924c10b19f0e760e6f (patch)
treedce04f454951d4aa0786589fe863cc3fa21b087d /synapse/metrics/metric.py
parentMerge pull request #3007 from matrix-org/rav/warn_on_logcontext_fail (diff)
parentNote that label values can be anything (diff)
downloadsynapse-0b7dfbb194018d22118a90924c10b19f0e760e6f.tar.xz
Merge pull request #3186 from matrix-org/erikj/fix_int_values_metrics
Fix metrics that have integer value labels
Diffstat (limited to 'synapse/metrics/metric.py')
-rw-r--r--synapse/metrics/metric.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/metrics/metric.py b/synapse/metrics/metric.py
index fbba94e633..f421e7a93f 100644
--- a/synapse/metrics/metric.py
+++ b/synapse/metrics/metric.py
@@ -71,7 +71,8 @@ class BaseMetric(object):
         """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:
@@ -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))