No description
Find a file
2026-01-27 02:09:37 +03:00
bot-data Initial commit 2025-04-05 17:18:01 +03:00
src initialize last mtime with actual fs value 2026-01-27 02:09:37 +03:00
.env.example add userbot login options via env vars 2025-04-06 22:05:28 +03:00
.gitignore initial commit or smth 2025-04-06 00:01:03 +03:00
docker-compose.yaml add optional sender info collection, chat members count collection; some structurizing; reactions collector disclaimer 2026-01-23 16:58:48 +03:00
Dockerfile meow 2025-04-07 16:26:31 +03:00
eslint.config.js initial commit or smth 2025-04-06 00:01:03 +03:00
keywords.yml.example fix word borders in regexps; add regexp flags to config file 2026-01-26 01:26:24 +03:00
package.json initialize last mtime with actual fs value 2026-01-27 02:09:37 +03:00
pnpm-lock.yaml add optional sender info collection, chat members count collection; some structurizing; reactions collector disclaimer 2026-01-23 16:58:48 +03:00
README.md fix lint 2025-04-08 13:42:47 +03:00
tsconfig.json Initial commit 2025-04-05 17:18:01 +03:00

mtproto_exporter

mtcute powered Prometheus metrics exporter

this exporter is mostly useful only with userbot

Available Metrics

messenger_dialog_info{peerId, peerType, displayName}

Dialog information exposed as labels

messenger_dialog_messages_count{peerId}

Messages count since exporter startup

messenger_dialog_unread_messages_count{peerId}

Number of unread messages in dialogs

messenger_dialog_keywords_count{peerId}

Number of keywords found in messages since exporter startup

messenger_dialog_words_count{peerId}

Number of words in messages since exporter startup

This metric is disabled by default because it will produce a lot of unique time series (more info here)

This will expose each word in each message in each chat as unique metric.

This metric can be enabled with command line flag --words-counter

CLI Options

--bind-host, -b - ip address where http server will be listening on

--port, -p - port where http server will be listening on

--words-counter - enable each word counting metric

--keywords-file, -k - path to yaml file with keywords and patterns (see keywords.yml.example)

--watch-file, -w - watch for keywords file updates and reload keywords configuration in runtime

--include-peers, -i - comma-separated list of peer.ids to gather metrics from. if set, only specified peers will be exposed in metrics. can be specified multiple times. can not be used along with --exclude-peers

--exclude-peers x - comma-separated list of peer.ids to exclude from metrics. if set, specified peers will not be exposed in metrics. can be specified multiple times. can not be used along with --include-peers

Environment Variables

API_ID - Telegram api id used for mtproto connection (see mtcute.dev)

API_HASH - Telegram api hash used for mtproto connection (see mtcute.dev)

Development

pnpm install --frozen-lockfile
cp .env.example .env
# edit .env
pnpm start

generated with @mtcute/create-bot