mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-18 07:52:56 +01:00
Merge pull request #6003 from matrix-org/erikj/push_opentracing
Add opentracing span for HTTP push
This commit is contained in:
commit
ea6956c55c
2 changed files with 13 additions and 1 deletions
1
changelog.d/6003.misc
Normal file
1
changelog.d/6003.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Add opentracing span over HTTP push processing.
|
|
@ -22,6 +22,7 @@ from prometheus_client import Counter
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.internet.error import AlreadyCalled, AlreadyCancelled
|
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.metrics.background_process_metrics import run_as_background_process
|
||||||
from synapse.push import PusherConfigException
|
from synapse.push import PusherConfigException
|
||||||
|
|
||||||
|
@ -194,7 +195,17 @@ class HttpPusher(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
for push_action in unprocessed:
|
for push_action in unprocessed:
|
||||||
|
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)
|
processed = yield self._process_one(push_action)
|
||||||
|
|
||||||
if processed:
|
if processed:
|
||||||
http_push_processed_counter.inc()
|
http_push_processed_counter.inc()
|
||||||
self.backoff_delay = HttpPusher.INITIAL_BACKOFF_SEC
|
self.backoff_delay = HttpPusher.INITIAL_BACKOFF_SEC
|
||||||
|
|
Loading…
Reference in a new issue