summary refs log tree commit diff
path: root/synapse/appservice/api.py
diff options
context:
space:
mode:
authorBrad Murray <brad@beeper.com>2022-07-13 10:18:20 -0400
committerGitHub <noreply@github.com>2022-07-13 15:18:20 +0100
commit3371e1abcb607776c6351ab5d73ba38f1db8a8f2 (patch)
tree40fee2e03aff6411db97e8a232736814384f485f /synapse/appservice/api.py
parentDrop unused tables from groups/communities. (#12967) (diff)
downloadsynapse-3371e1abcb607776c6351ab5d73ba38f1db8a8f2.tar.xz
Add prometheus counters for content types other than events (#13175)
Diffstat (limited to '')
-rw-r--r--synapse/appservice/api.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py
index df1c214462..0963fb3bb4 100644
--- a/synapse/appservice/api.py
+++ b/synapse/appservice/api.py
@@ -53,6 +53,18 @@ sent_events_counter = Counter(
     "synapse_appservice_api_sent_events", "Number of events sent to the AS", ["service"]
 )
 
+sent_ephemeral_counter = Counter(
+    "synapse_appservice_api_sent_ephemeral",
+    "Number of ephemeral events sent to the AS",
+    ["service"],
+)
+
+sent_todevice_counter = Counter(
+    "synapse_appservice_api_sent_todevice",
+    "Number of todevice messages sent to the AS",
+    ["service"],
+)
+
 HOUR_IN_MS = 60 * 60 * 1000
 
 
@@ -310,6 +322,8 @@ class ApplicationServiceApi(SimpleHttpClient):
                 )
             sent_transactions_counter.labels(service.id).inc()
             sent_events_counter.labels(service.id).inc(len(serialized_events))
+            sent_ephemeral_counter.labels(service.id).inc(len(ephemeral))
+            sent_todevice_counter.labels(service.id).inc(len(to_device_messages))
             return True
         except CodeMessageException as e:
             logger.warning(