statsd middleware for Telegraf
statsd middleware for Telegraf (Telegram bot framework).
Installation
$ npm install telegraf-statsd
Example
const Telegraf = const stats = const telegraf = processenvBOT_TOKEN telegraf telegraf telegraf
API
Options
host
- optional statsd hostport
- optional statsd portprefix
- optional statsd prefix ('.' is appended)tcp
- use TCP instead of UDP
User context
Telegraf user context props and functions:
app
Metrics
Metric name | Type | Description |
---|---|---|
counter |
counter |
bot updates counter |
<type>.count |
counter |
update type counter (message, inlineQuery, etc.) |
message.<subtype>.count |
counter |
message subtype counter(text, sticker, etc.) |
errors.count |
counter |
error counter |
errors.<type>.count |
counter |
update type error counter |
errors.message.<subtype>.count |
counter |
message subtype error counter |
duration |
timer |
handler duration |
<type>.duration |
timer |
update type handler duration |
message.<subtype>.duration |
timer |
message subtype handler duration |
chats |
set |
chats set |
users |
set |
users set |
text.size |
histogram |
text messages length |