mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 01:30:13 +00:00
feat: add metric for remaining gateway sessions
This commit is contained in:
parent
c58eb274df
commit
b77390c0cd
4 changed files with 34 additions and 1 deletions
|
|
@ -25,7 +25,13 @@ pub async fn update_prometheus(ctx: AppCtx) -> anyhow::Result<()> {
|
|||
|
||||
gauge!("pluralkit_image_cleanup_queue_length").set(count.count as f64);
|
||||
|
||||
// todo: remaining shard session_start_limit
|
||||
let gateway = ctx.discord.gateway().authed().await?.model().await?;
|
||||
|
||||
gauge!("pluralkit_gateway_sessions_remaining")
|
||||
.set(gateway.session_start_limit.remaining as f64);
|
||||
gauge!("pluralkit_gateway_sessions_reset_after")
|
||||
.set(gateway.session_start_limit.reset_after as f64);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue