Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit ddc10da

Browse files
committed
Add counters for ephemeral and todevice messages being pushed to app services
1 parent d646f90 commit ddc10da

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

synapse/appservice/api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@
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", "Number of ephemeral events sent to the AS", ["service"]
58+
)
59+
60+
sent_todevice_counter = Counter(
61+
"synapse_appservice_api_sent_todevice", "Number of todevice messages sent to the AS", ["service"]
62+
)
63+
5664
HOUR_IN_MS = 60 * 60 * 1000
5765

5866

@@ -310,6 +318,8 @@ async def push_bulk(
310318
)
311319
sent_transactions_counter.labels(service.id).inc()
312320
sent_events_counter.labels(service.id).inc(len(serialized_events))
321+
sent_ephemeral_counter.labels(service.id).inc(len(ephemeral))
322+
sent_todevice_counter.labels(service.id).inc(len(to_device_messages))
313323
return True
314324
except CodeMessageException as e:
315325
logger.warning(

0 commit comments

Comments
 (0)