You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Add stats API key scope to allow external observability tool access #10957
Add a readonly stats API key scope that allows access to the existing runtime and token usage statistics endpoints:
GET /api/v1/stats
GET /api/v1/stats/provider-tokens
Currently, these endpoints require dashboard authentication because their system scope is unavailable to developer API keys. The new scope would let external tools retrieve statistics without dashboard credentials.
The scope would require explicit selection and would not grant administrative permissions.
Reference implementation
A reference implementation is provided in PR #10956.
Use Case
Operators running AstrBot alongside external monitoring systems need to collect runtime and token usage statistics for centralized dashboards and monitoring.
As a concrete example, a Prometheus exporter for AstrBot could query these endpoints using an API key with only the stats scope, then convert the JSON responses into monitoring metrics.
The operators can then setup proper monitoring and alert systems for reliability operations, such as alerting when the bot is down, or notifying when token rate exceeds certain threshold.
Checklist
I have searched the Issue list for related features and confirmed this feature idea has never been proposed.
The feature I am suggesting is related to AstrBot itself, not to a specific plugin.
Activity