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 #6003 from matrix-org/erikj/push_opentracing
Browse files Browse the repository at this point in the history
Add opentracing span for HTTP push
  • Loading branch information
erikjohnston authored Sep 9, 2019
2 parents 55d5b3a + a852e93 commit ea6956c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/6003.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add opentracing span over HTTP push processing.
13 changes: 12 additions & 1 deletion synapse/push/httppusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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

Expand Down Expand Up @@ -194,7 +195,17 @@ def _unsafe_process(self):
)

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
Expand Down

0 comments on commit ea6956c

Please sign in to comment.