Public health and metrics commands #44

Closed
opened 2026-02-15 04:13:25 +03:00 by NiXTheDev · 0 comments
NiXTheDev commented 2026-02-15 04:13:25 +03:00 (Migrated from github.com)

Description

Make health and performance metrics accessible to all users via public commands.

Use Case

Users and administrators want visibility into bot performance and health without needing special access.

Implementation Plan

  1. Create metrics command

    • /health - Show system health status
    • /metrics - Show performance statistics
  2. Health command output

    Bot Health Status: HEALTHY
    
    Workers: 4 active, 2 idle
    Queue: 0 pending tasks
    Error Rate: 0.0%
    Uptime: 2h 34m
    
  3. Metrics command output

    Performance Metrics:
    
    Cache Hit Rate: 78%
    Avg Processing Time: 12ms
    Total Substitutions: 1,247
    Regex Compilations: 156 (cached: 89)
    
  4. Integration

    • Register commands with @grammyjs/commands
    • Pull data from HealthMonitor
    • Format for readability
  5. Privacy considerations

    • No user-specific data
    • Aggregated stats only
    • No sensitive information

Acceptance Criteria

  • /health command shows system status
  • /metrics command shows performance data
  • Output is clean and readable
  • Updates in real-time
  • Accessible to any user

Part of Epic #38

## Description Make health and performance metrics accessible to all users via public commands. ## Use Case Users and administrators want visibility into bot performance and health without needing special access. ## Implementation Plan 1. **Create metrics command** - /health - Show system health status - /metrics - Show performance statistics 2. **Health command output** ``` Bot Health Status: HEALTHY Workers: 4 active, 2 idle Queue: 0 pending tasks Error Rate: 0.0% Uptime: 2h 34m ``` 3. **Metrics command output** ``` Performance Metrics: Cache Hit Rate: 78% Avg Processing Time: 12ms Total Substitutions: 1,247 Regex Compilations: 156 (cached: 89) ``` 4. **Integration** - Register commands with @grammyjs/commands - Pull data from HealthMonitor - Format for readability 5. **Privacy considerations** - No user-specific data - Aggregated stats only - No sensitive information ## Acceptance Criteria - [ ] /health command shows system status - [ ] /metrics command shows performance data - [ ] Output is clean and readable - [ ] Updates in real-time - [ ] Accessible to any user ## Related Part of Epic #38
Sign in to join this conversation.
No description provided.