This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 1+ Add prometheus counters for ephemeral events and to device messages pushed to app services. Contributed by Brad @ Beeper.
Original file line number Diff line number Diff line change 5353 "synapse_appservice_api_sent_events" , "Number of events sent to the AS" , ["service" ]
5454)
5555
56+ sent_ephemeral_counter = Counter (
57+ "synapse_appservice_api_sent_ephemeral" ,
58+ "Number of ephemeral events sent to the AS" ,
59+ ["service" ],
60+ )
61+
62+ sent_todevice_counter = Counter (
63+ "synapse_appservice_api_sent_todevice" ,
64+ "Number of todevice messages sent to the AS" ,
65+ ["service" ],
66+ )
67+
5668HOUR_IN_MS = 60 * 60 * 1000
5769
5870
@@ -310,6 +322,8 @@ async def push_bulk(
310322 )
311323 sent_transactions_counter .labels (service .id ).inc ()
312324 sent_events_counter .labels (service .id ).inc (len (serialized_events ))
325+ sent_ephemeral_counter .labels (service .id ).inc (len (ephemeral ))
326+ sent_todevice_counter .labels (service .id ).inc (len (to_device_messages ))
313327 return True
314328 except CodeMessageException as e :
315329 logger .warning (
You can’t perform that action at this time.
0 commit comments