Update telemetry
Some checks failed
Rust / Test (push) Has been cancelled
Rust / Rustfmt (push) Has been cancelled
Rust / Clippy (push) Has been cancelled
Rust / Code coverage (push) Has been cancelled

This commit is contained in:
Alphonse Paix
2025-09-28 03:37:23 +02:00
parent ac96b3c249
commit 1117d49746
20 changed files with 120 additions and 116 deletions

View File

@@ -31,6 +31,10 @@ pub struct UnsubFormData {
email: String,
}
#[tracing::instrument(
name = "Removing subscriber from database",
skip(connection_pool, email_client, base_url)
)]
pub async fn post_unsubscribe(
State(AppState {
connection_pool,
@@ -54,7 +58,7 @@ pub async fn post_unsubscribe(
Ok(Html(template.render().unwrap()).into_response())
}
#[tracing::instrument(name = "Fetching unsubscribe token from the database", skip_all)]
#[tracing::instrument(name = "Fetching unsubscribe token from database", skip_all)]
async fn fetch_unsubscribe_token(
connection_pool: &PgPool,
subscriber_email: &SubscriberEmail,
@@ -69,7 +73,7 @@ async fn fetch_unsubscribe_token(
Ok(r.and_then(|r| r.unsubscribe_token))
}
#[tracing::instrument(name = "Send an unsubscribe confirmation email", skip_all)]
#[tracing::instrument(name = "Send an confirmation email", skip_all)]
pub async fn send_unsubscribe_email(
email_client: &EmailClient,
subscriber_email: &SubscriberEmail,
@@ -102,7 +106,7 @@ If you did not request this, you can safely ignore this email."#,
.await
}
#[tracing::instrument(name = "Removing user from database if he exists", skip_all)]
#[tracing::instrument(name = "Removing user from database", skip(connection_pool))]
pub async fn unsubscribe_confirm(
Query(UnsubQueryParams { token }): Query<UnsubQueryParams>,
State(AppState {