forked from vijfhoek/regexbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetrics.py
More file actions
31 lines (25 loc) · 815 Bytes
/
metrics.py
File metadata and controls
31 lines (25 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from prometheus_client import Counter, Histogram, Gauge, Summary, start_http_server
MESSAGES_PROCESSED = Counter(
'regexbot_messages_processed_total',
'Total number of messages the bot has processed'
)
SED_COMMANDS = Counter(
'regexbot_sed_commands_total',
'Total number of sed substitution commands processed'
)
SED_ERRORS = Counter(
'regexbot_sed_errors_total',
'Number of errors encountered during sed processing'
)
SUBSTITUTIONS = Counter(
'regexbot_substitutions_total',
'Number of successful substitutions (i.e. messages changed)'
)
SUBSTITUTION_LATENCY = Histogram(
'regexbot_substitution_latency_seconds',
'Latency (in seconds) for performing a substitution'
)
UNIQUE_CHATS = Gauge(
'regexbot_unique_chats',
'Number of unique Telegram chats observed'
)