From 55f1f2e51805ccbbd4ef04bf39daf3bc7a4673ce Mon Sep 17 00:00:00 2001 From: Piotr Orzechowski Date: Fri, 22 Mar 2024 08:01:50 +0100 Subject: [PATCH] Fix tracing names --- src/routes/newsletters.rs | 12 ++++++------ src/routes/subscriptions.rs | 10 +++++----- src/routes/subscriptions_confirm.rs | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/routes/newsletters.rs b/src/routes/newsletters.rs index 686f425..2e2a022 100644 --- a/src/routes/newsletters.rs +++ b/src/routes/newsletters.rs @@ -23,7 +23,7 @@ pub fn router() -> Router { } #[tracing::instrument( - name = "Publishing newsletter", + name = "Publish newsletter", skip(headers, app_state, body), fields(username=tracing::field::Empty, user_id=tracing::field::Empty) )] @@ -63,7 +63,7 @@ async fn publish_newsletter( Ok(()) } -#[tracing::instrument(name = "Extracting basic auth credentials", skip(headers))] +#[tracing::instrument(name = "Extract basic auth credentials", skip(headers))] fn basic_authentication(headers: &HeaderMap) -> Result { let base64encoded_segment = headers .get("Authorization") @@ -98,7 +98,7 @@ fn basic_authentication(headers: &HeaderMap) -> Result Result>, anyhow::Error> { diff --git a/src/routes/subscriptions.rs b/src/routes/subscriptions.rs index b7379b3..9b44c9a 100644 --- a/src/routes/subscriptions.rs +++ b/src/routes/subscriptions.rs @@ -26,7 +26,7 @@ pub fn router() -> Router { } #[tracing::instrument( - name = "Adding new subscriber", + name = "Add new subscriber", skip(app_state, form), fields( subscriber_email = %form.email, @@ -76,7 +76,7 @@ async fn subscribe( } #[tracing::instrument( - name = "Getting subscriber details from the database", + name = "Get subscriber details from the database", skip(transaction, email) )] async fn get_subscription( @@ -107,7 +107,7 @@ async fn get_subscription( } #[tracing::instrument( - name = "Saving new subscriber details in the database", + name = "Save new subscriber details in the database", skip(transaction, new_subscriber) )] async fn insert_subscriber( @@ -136,7 +136,7 @@ async fn insert_subscriber( } #[tracing::instrument( - name = "Storing subscription token in the database", + name = "Store subscription token in the database", skip(transaction, subscription_token) )] async fn store_token( @@ -162,7 +162,7 @@ async fn store_token( } #[tracing::instrument( - name = "Sending confirmation email to a new subscriber", + name = "Send confirmation email to a new subscriber", skip(email_client, new_subscriber, base_url, subscription_token) )] async fn send_confirmation_email( diff --git a/src/routes/subscriptions_confirm.rs b/src/routes/subscriptions_confirm.rs index e2ee516..7dd1114 100644 --- a/src/routes/subscriptions_confirm.rs +++ b/src/routes/subscriptions_confirm.rs @@ -56,7 +56,7 @@ struct Parameters { } #[tracing::instrument( - name = "Getting subscriber_id from token", + name = "Get subscriber_id from token", skip(transaction, subscription_token) )] async fn get_subscriber_id_from_token( @@ -86,7 +86,7 @@ async fn get_subscriber_id_from_token( } #[tracing::instrument( - name = "Marking subscriber as confirmed", + name = "Mark subscriber as confirmed", skip(transaction, subscriber_id) )] async fn confirm_subscriber( @@ -111,7 +111,7 @@ async fn confirm_subscriber( } #[tracing::instrument( - name = "Deleting subscribe confirmation tokens", + name = "Delete subscription confirmation tokens", skip(transaction, subscriber_id) )] async fn delete_confirmation_tokens(