summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/sendtodevice.py
diff options
context:
space:
mode:
authorJorik Schellekens <joriks@matrix.org>2019-06-28 17:16:07 +0100
committerJorik Schellekens <joriks@matrix.org>2019-07-23 16:01:06 +0100
commitc988c02c7cafb503f36c119d343b0a33b8171330 (patch)
tree864b5174cbeb6866586878ac3c2f643de82acea9 /synapse/rest/client/v2_alpha/sendtodevice.py
parentTrace devices (diff)
downloadsynapse-c988c02c7cafb503f36c119d343b0a33b8171330.tar.xz
Trace device messages.
Diffstat (limited to 'synapse/rest/client/v2_alpha/sendtodevice.py')
-rw-r--r--synapse/rest/client/v2_alpha/sendtodevice.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/sendtodevice.py b/synapse/rest/client/v2_alpha/sendtodevice.py
index 2613648d82..a7782cbd7c 100644
--- a/synapse/rest/client/v2_alpha/sendtodevice.py
+++ b/synapse/rest/client/v2_alpha/sendtodevice.py
@@ -20,6 +20,11 @@ from twisted.internet import defer
 from synapse.http import servlet
 from synapse.http.servlet import parse_json_object_from_request
 from synapse.rest.client.transactions import HttpTransactionCache
+from synapse.util.tracerutils import (
+    TracerUtil,
+    trace_defered_function_using_operation_name,
+    tag_args,
+)
 
 from ._base import client_patterns
 
@@ -42,7 +47,10 @@ class SendToDeviceRestServlet(servlet.RestServlet):
         self.txns = HttpTransactionCache(hs)
         self.device_message_handler = hs.get_device_message_handler()
 
+    @trace_defered_function_using_operation_name("sendToDevice")
     def on_PUT(self, request, message_type, txn_id):
+        TracerUtil.set_tag("message_type", message_type)
+        TracerUtil.set_tag("txn_id", txn_id)
         return self.txns.fetch_or_execute_request(
             request, self._put, request, message_type, txn_id
         )