Added metric events by Zabuzard · Pull Request #1433 · Together-Java/TJ-Bot

What

Recently we added a system to track metrics. This PR now went through the full codebase and added a bunch of low hanging events. There are still some events that would be nice to track that arent tracked right now but the PR should cover the majority of our metric-needs.

Test

Played a bit with the bot locally, the DB is populated as expected:

example

Events

The general naming scheme is topic-topic_detail-detail, example dynamic_voice_channel-created or help-ai_dismiss.

The following events are now tracked:

  • (existed already) slash-<name>, all slash command usages
  • user_ctx-<name>, all user context commands
  • msg_ctx-<name>, all message context commands
  • tag-<id>, the name of a specific tag being used (e.g. /tag id:learn)
  • suggestion, a server-suggestion has been posted
  • chatgpt-prompted, the chatgpt service has been prompted (for any feature)
  • code_action-<label>, a code action has been used (e.g. format or run)
  • file_sharing-uploaded, a file has been uploaded by the bot (GIST service)
  • file_sharing-deleted, a user has clicked on the DELETE button for a previously uploaded file (GIST)
  • gh_reference, a github issue/PR/... has been mentioned in chat and the bot enriched it
  • autoprune_helper-<role>, the bot autopruned a helper role because it was full
  • op_left_thread, a thread was closed by the bot because its OP left the server
  • help-question_posted, a help-thread was created (i.e. a user asked a question)
  • help-category-<category>, a help thread with the given category was created (or its category was changed to that category)
  • help-ai_dismiss, someone dismissed the automatic AI response for a help thread
  • media_only_channel-msg_deleted, the bot deleted a message without media in a media-only channel
  • blacklisted_attachment-deleted, the bot deleted a message that contained a blacklisted attachment (e.g. an exe file)
  • scam-detected, the bot detected a scam message (in a wave it counts only once)
  • mod-user_rejoined_reapplied_role, a user who was for example muted left and rejoined the server, the bot reapplied the role
  • rss-item_posted, the bot posted an item from a RSS feed (for example a youtube video)
  • top_helper-<user_id>, a user was awared Top Helper (only counts if done through the auto-assignment, not manually giving the role)
  • dynamic_voice_channel-created, a dynamic voice channel was created