Metrics (Prometheus)
The gateway exposes a/metrics endpoint that returns metrics in Prometheus exposition format. This enables integration with monitoring systems like Prometheus, Grafana, and other observability tools.
Endpoint
Available Metrics
Gateway Metrics
Labels:
channel: The messaging channel (e.g.,telegram)type: Message type (text,media,command) or error type (processing,network,timeout)
Telegram Metrics
Labels:
type: Message type (text,media,command)reason: Reconnection reason (network,conflict,timeout)
Node.js Runtime Metrics
Standard Node.js runtime metrics are also exposed withnodejs_ and process_ prefixes:
process_cpu_user_seconds_total- CPU time in user modeprocess_cpu_system_seconds_total- CPU time in system modeprocess_resident_memory_bytes- Resident memory sizeprocess_heap_bytes- Heap memory sizenodejs_active_handles_total- Active libuv handlesnodejs_eventloop_lag_seconds- Event loop lag- And more…
Example Output
Prometheus Configuration
Add the gateway to your Prometheus scrape config:Grafana Dashboard
Example queries for a Grafana dashboard:Health vs Metrics
/health- Simple JSON health check for platform probes (Fly.io, Docker, k8s)/metrics- Full Prometheus metrics for detailed observability
/health for liveness/readiness probes and /metrics for monitoring dashboards.