summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-09-09 15:08:06 +0100
committerGitHub <noreply@github.com>2019-09-09 15:08:06 +0100
commitea6956c55cf7e472d54bf4c411d21a1d84967cb8 (patch)
tree091ee949e2f2bc131428d6d59e7232ae929eb9b3
parentServers-known-about statistic (#5981) (diff)
parentNewsfile (diff)
downloadsynapse-ea6956c55cf7e472d54bf4c411d21a1d84967cb8.tar.xz
Merge pull request #6003 from matrix-org/erikj/push_opentracing
Add opentracing span for HTTP push
-rw-r--r--changelog.d/6003.misc1
-rw-r--r--synapse/push/httppusher.py13
2 files changed, 13 insertions, 1 deletions
diff --git a/changelog.d/6003.misc b/changelog.d/6003.misc
new file mode 100644
index 0000000000..4152d05f87
--- /dev/null
+++ b/changelog.d/6003.misc
@@ -0,0 +1 @@
+Add opentracing span over HTTP push processing.
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py
index bd5d53af91..6299587808 100644
--- a/synapse/push/httppusher.py
+++ b/synapse/push/httppusher.py
@@ -22,6 +22,7 @@ from prometheus_client import Counter
 from twisted.internet import defer
 from twisted.internet.error import AlreadyCalled, AlreadyCancelled
 
+from synapse.logging import opentracing
 from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.push import PusherConfigException
 
@@ -194,7 +195,17 @@ class HttpPusher(object):
         )
 
         for push_action in unprocessed:
-            processed = yield self._process_one(push_action)
+            with opentracing.start_active_span(
+                "http-push",
+                tags={
+                    "authenticated_entity": self.user_id,
+                    "event_id": push_action["event_id"],
+                    "app_id": self.app_id,
+                    "app_display_name": self.app_display_name,
+                },
+            ):
+                processed = yield self._process_one(push_action)
+
             if processed:
                 http_push_processed_counter.inc()
                 self.backoff_delay = HttpPusher.INITIAL_BACKOFF_SEC