We need a metrics handler, tbd the final provider, probably to be sent to influxDB.
For now, we want a new file within mel called metrics.py that we will use for all the metrics functionallities.
In this file we will prepare the metrics according to the parameters, some from the context, and some will have defaults.
I am thinking on something like:
send_datetime is the datetime of the metric to be sent. We will probably use this as the key for some other feature.
data contains the actual metric. It could be:
[('count', 1), ('group_id', 123456)]
The expected output will follow the format:
<timestamp> <data>
Where data has the following format:
identifier0=value0,identifier1=value1...
With the previous values:
"12345678 count=1,group_id=123456"
Aside from that we will also need some data in order to store the metrics using the ChatID and the TelegramUser, those are extracted from the Context. We would like both methods in the utils.py
get_telegram_group_id(context: CallbackContext) -> int
get_telegram_user_id(context: CallbackContext) -> int
We need a metrics handler, tbd the final provider, probably to be sent to influxDB. For now, we want a new file within
mel
calledmetrics.py
that we will use for all the metrics functionallities. In this file we will prepare the metrics according to the parameters, some from the context, and some will have defaults. I am thinking on something like:data
contains the actual metric. It could be:The expected output will follow the format:
Where data has the following format:
With the previous values:
Aside from that we will also need some data in order to store the metrics using the ChatID and the TelegramUser, those are extracted from the Context. We would like both methods in the
utils.py