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

Commit 3371e1a

Browse files
authored
Add prometheus counters for content types other than events (#13175)
1 parent 4db7862 commit 3371e1a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

changelog.d/13175.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add prometheus counters for ephemeral events and to device messages pushed to app services. Contributed by Brad @ Beeper.

synapse/appservice/api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@
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+
5668
HOUR_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(

0 commit comments

Comments
 (0)