Add metrics
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
use poise::serenity_prelude::ActivityData;
|
||||
use poise::{
|
||||
serenity_prelude as serenity,
|
||||
serenity_prelude::{CreateEmbed, CreateMessage, FullEvent},
|
||||
serenity_prelude::{ActivityData, CreateEmbed, CreateMessage, FullEvent},
|
||||
};
|
||||
|
||||
use crate::{component_models::ComponentDataModel, Data, Error, THEME_COLOR};
|
||||
use crate::{
|
||||
component_models::ComponentDataModel, metrics::COMMAND_COUNTER, Data, Error, THEME_COLOR,
|
||||
};
|
||||
|
||||
pub async fn listener(
|
||||
ctx: &serenity::Context,
|
||||
@@ -67,6 +68,10 @@ To stay up to date on the latest features and fixes, join our [Discord](https://
|
||||
|
||||
component_model.act(ctx, data, &component).await;
|
||||
}
|
||||
|
||||
if let Some(command) = interaction.clone().command() {
|
||||
COMMAND_COUNTER.with_label_values(&[command.data.name.as_str()]).inc();
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user