From f92b36098cd60909b3ef7ab8c491cd22bd5d5ce7 Mon Sep 17 00:00:00 2001 From: Piotr Gankiewicz Date: Sat, 14 Dec 2024 13:24:12 +0100 Subject: [PATCH] Unify trace messages (#1390) --- Cargo.lock | 2 +- server/Cargo.toml | 2 +- .../create_consumer_group_handler.rs | 2 +- .../delete_consumer_group_handler.rs | 2 +- .../consumer_groups/join_consumer_group_handler.rs | 2 +- .../leave_consumer_group_handler.rs | 2 +- .../messages/flush_unsaved_buffer_handler.rs | 2 +- .../partitions/create_partitions_handler.rs | 2 +- .../partitions/delete_partitions_handler.rs | 2 +- .../create_personal_access_token_handler.rs | 2 +- .../delete_personal_access_token_handler.rs | 2 +- .../login_with_personal_access_token_handler.rs | 2 +- .../handlers/streams/create_stream_handler.rs | 2 +- .../handlers/streams/delete_stream_handler.rs | 2 +- .../handlers/streams/purge_stream_handler.rs | 2 +- .../handlers/streams/update_stream_handler.rs | 2 +- .../binary/handlers/topics/create_topic_handler.rs | 2 +- .../binary/handlers/topics/delete_topic_handler.rs | 2 +- .../binary/handlers/topics/purge_topic_handler.rs | 2 +- .../binary/handlers/topics/update_topic_handler.rs | 2 +- .../handlers/users/change_password_handler.rs | 2 +- .../binary/handlers/users/create_user_handler.rs | 2 +- .../binary/handlers/users/delete_user_handler.rs | 2 +- .../binary/handlers/users/login_user_handler.rs | 2 +- .../binary/handlers/users/logout_user_handler.rs | 2 +- .../handlers/users/update_permissions_handler.rs | 2 +- .../binary/handlers/users/update_user_handler.rs | 2 +- server/src/channels/commands/archive_state.rs | 2 +- .../commands/clean_personal_access_tokens.rs | 2 +- server/src/channels/commands/maintain_messages.rs | 2 +- server/src/channels/commands/save_messages.rs | 2 +- server/src/channels/commands/verify_heartbeats.rs | 2 +- server/src/http/consumer_groups.rs | 4 ++-- server/src/http/messages.rs | 2 +- server/src/http/partitions.rs | 4 ++-- server/src/http/personal_access_tokens.rs | 6 +++--- server/src/http/streams.rs | 8 ++++---- server/src/http/topics.rs | 8 ++++---- server/src/http/users.rs | 14 +++++++------- server/src/main.rs | 2 +- server/src/streaming/systems/system.rs | 6 +++--- 41 files changed, 59 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc657ee15..2facf709e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4262,7 +4262,7 @@ dependencies = [ [[package]] name = "server" -version = "0.4.85" +version = "0.4.86" dependencies = [ "ahash 0.8.11", "anyhow", diff --git a/server/Cargo.toml b/server/Cargo.toml index ce64e501e..acf6a10f8 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "server" -version = "0.4.85" +version = "0.4.86" edition = "2021" build = "src/build.rs" diff --git a/server/src/binary/handlers/consumer_groups/create_consumer_group_handler.rs b/server/src/binary/handlers/consumer_groups/create_consumer_group_handler.rs index 4c7b1ed46..6ab081a86 100644 --- a/server/src/binary/handlers/consumer_groups/create_consumer_group_handler.rs +++ b/server/src/binary/handlers/consumer_groups/create_consumer_group_handler.rs @@ -8,7 +8,7 @@ use iggy::consumer_groups::create_consumer_group::CreateConsumerGroup; use iggy::error::IggyError; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] +#[instrument(skip_all, name = "trace_create_consumer_group", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] pub async fn handle( command: CreateConsumerGroup, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/consumer_groups/delete_consumer_group_handler.rs b/server/src/binary/handlers/consumer_groups/delete_consumer_group_handler.rs index c33aa8f16..d285a2d08 100644 --- a/server/src/binary/handlers/consumer_groups/delete_consumer_group_handler.rs +++ b/server/src/binary/handlers/consumer_groups/delete_consumer_group_handler.rs @@ -7,7 +7,7 @@ use iggy::consumer_groups::delete_consumer_group::DeleteConsumerGroup; use iggy::error::IggyError; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] +#[instrument(skip_all, name = "trace_delete_consumer_group", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] pub async fn handle( command: DeleteConsumerGroup, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/consumer_groups/join_consumer_group_handler.rs b/server/src/binary/handlers/consumer_groups/join_consumer_group_handler.rs index df5f89478..43548b0ba 100644 --- a/server/src/binary/handlers/consumer_groups/join_consumer_group_handler.rs +++ b/server/src/binary/handlers/consumer_groups/join_consumer_group_handler.rs @@ -6,7 +6,7 @@ use iggy::consumer_groups::join_consumer_group::JoinConsumerGroup; use iggy::error::IggyError; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string(), iggy_group_id = command.group_id.as_string()))] +#[instrument(skip_all, name = "trace_join_consumer_group", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string(), iggy_group_id = command.group_id.as_string()))] pub async fn handle( command: JoinConsumerGroup, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/consumer_groups/leave_consumer_group_handler.rs b/server/src/binary/handlers/consumer_groups/leave_consumer_group_handler.rs index 416cd4452..d19a95689 100644 --- a/server/src/binary/handlers/consumer_groups/leave_consumer_group_handler.rs +++ b/server/src/binary/handlers/consumer_groups/leave_consumer_group_handler.rs @@ -6,7 +6,7 @@ use iggy::consumer_groups::leave_consumer_group::LeaveConsumerGroup; use iggy::error::IggyError; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string(), iggy_group_id = command.group_id.as_string()))] +#[instrument(skip_all, name = "trace_leave_consumer_group", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string(), iggy_group_id = command.group_id.as_string()))] pub async fn handle( command: LeaveConsumerGroup, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/messages/flush_unsaved_buffer_handler.rs b/server/src/binary/handlers/messages/flush_unsaved_buffer_handler.rs index 85f6c4abd..dbcaf8ab4 100644 --- a/server/src/binary/handlers/messages/flush_unsaved_buffer_handler.rs +++ b/server/src/binary/handlers/messages/flush_unsaved_buffer_handler.rs @@ -6,7 +6,7 @@ use iggy::error::IggyError; use iggy::messages::flush_unsaved_buffer::FlushUnsavedBuffer; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string(), iggy_partition_id = command.partition_id, iggy_fsync = command.fsync))] +#[instrument(skip_all, name = "trace_flush_unsaved_buffer", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string(), iggy_partition_id = command.partition_id, iggy_fsync = command.fsync))] pub async fn handle( command: FlushUnsavedBuffer, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/partitions/create_partitions_handler.rs b/server/src/binary/handlers/partitions/create_partitions_handler.rs index 0de42e406..a0b933e28 100644 --- a/server/src/binary/handlers/partitions/create_partitions_handler.rs +++ b/server/src/binary/handlers/partitions/create_partitions_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::partitions::create_partitions::CreatePartitions; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] +#[instrument(skip_all, name = "trace_create_partitions", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] pub async fn handle( command: CreatePartitions, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/partitions/delete_partitions_handler.rs b/server/src/binary/handlers/partitions/delete_partitions_handler.rs index b24e98b51..1c72edd1c 100644 --- a/server/src/binary/handlers/partitions/delete_partitions_handler.rs +++ b/server/src/binary/handlers/partitions/delete_partitions_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::partitions::delete_partitions::DeletePartitions; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] +#[instrument(skip_all, name = "trace_delete_partitions", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] pub async fn handle( command: DeletePartitions, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/personal_access_tokens/create_personal_access_token_handler.rs b/server/src/binary/handlers/personal_access_tokens/create_personal_access_token_handler.rs index ee9e37d06..a87ba22bf 100644 --- a/server/src/binary/handlers/personal_access_tokens/create_personal_access_token_handler.rs +++ b/server/src/binary/handlers/personal_access_tokens/create_personal_access_token_handler.rs @@ -10,7 +10,7 @@ use iggy::error::IggyError; use iggy::personal_access_tokens::create_personal_access_token::CreatePersonalAccessToken; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_create_personal_access_token", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: CreatePersonalAccessToken, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/personal_access_tokens/delete_personal_access_token_handler.rs b/server/src/binary/handlers/personal_access_tokens/delete_personal_access_token_handler.rs index 47e273ec4..304612091 100644 --- a/server/src/binary/handlers/personal_access_tokens/delete_personal_access_token_handler.rs +++ b/server/src/binary/handlers/personal_access_tokens/delete_personal_access_token_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::personal_access_tokens::delete_personal_access_token::DeletePersonalAccessToken; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_delete_personal_access_token", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: DeletePersonalAccessToken, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/personal_access_tokens/login_with_personal_access_token_handler.rs b/server/src/binary/handlers/personal_access_tokens/login_with_personal_access_token_handler.rs index f368fe2d2..9c3847b82 100644 --- a/server/src/binary/handlers/personal_access_tokens/login_with_personal_access_token_handler.rs +++ b/server/src/binary/handlers/personal_access_tokens/login_with_personal_access_token_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::personal_access_tokens::login_with_personal_access_token::LoginWithPersonalAccessToken; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_login_with_personal_access_token", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: LoginWithPersonalAccessToken, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/streams/create_stream_handler.rs b/server/src/binary/handlers/streams/create_stream_handler.rs index 57de3dbb6..e78cb1f01 100644 --- a/server/src/binary/handlers/streams/create_stream_handler.rs +++ b/server/src/binary/handlers/streams/create_stream_handler.rs @@ -8,7 +8,7 @@ use iggy::error::IggyError; use iggy::streams::create_stream::CreateStream; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_create_stream", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: CreateStream, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/streams/delete_stream_handler.rs b/server/src/binary/handlers/streams/delete_stream_handler.rs index d636f94b1..3c0c7bb6b 100644 --- a/server/src/binary/handlers/streams/delete_stream_handler.rs +++ b/server/src/binary/handlers/streams/delete_stream_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::streams::delete_stream::DeleteStream; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string()))] +#[instrument(skip_all, name = "trace_delete_stream", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string()))] pub async fn handle( command: DeleteStream, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/streams/purge_stream_handler.rs b/server/src/binary/handlers/streams/purge_stream_handler.rs index eb3fb635c..61c24dc33 100644 --- a/server/src/binary/handlers/streams/purge_stream_handler.rs +++ b/server/src/binary/handlers/streams/purge_stream_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::streams::purge_stream::PurgeStream; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string()))] +#[instrument(skip_all, name = "trace_purge_stream", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string()))] pub async fn handle( command: PurgeStream, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/streams/update_stream_handler.rs b/server/src/binary/handlers/streams/update_stream_handler.rs index a60d2ff2d..a1ede70c1 100644 --- a/server/src/binary/handlers/streams/update_stream_handler.rs +++ b/server/src/binary/handlers/streams/update_stream_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::streams::update_stream::UpdateStream; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string()))] +#[instrument(skip_all, name = "trace_update_stream", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string()))] pub async fn handle( command: UpdateStream, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/topics/create_topic_handler.rs b/server/src/binary/handlers/topics/create_topic_handler.rs index afb15c567..cd90a4d7d 100644 --- a/server/src/binary/handlers/topics/create_topic_handler.rs +++ b/server/src/binary/handlers/topics/create_topic_handler.rs @@ -8,7 +8,7 @@ use iggy::error::IggyError; use iggy::topics::create_topic::CreateTopic; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string()))] +#[instrument(skip_all, name = "trace_create_topic", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string()))] pub async fn handle( mut command: CreateTopic, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/topics/delete_topic_handler.rs b/server/src/binary/handlers/topics/delete_topic_handler.rs index 3945f3604..d6aaf8a53 100644 --- a/server/src/binary/handlers/topics/delete_topic_handler.rs +++ b/server/src/binary/handlers/topics/delete_topic_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::topics::delete_topic::DeleteTopic; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] +#[instrument(skip_all, name = "trace_delete_topic", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] pub async fn handle( command: DeleteTopic, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/topics/purge_topic_handler.rs b/server/src/binary/handlers/topics/purge_topic_handler.rs index 6c2aff4df..79addd190 100644 --- a/server/src/binary/handlers/topics/purge_topic_handler.rs +++ b/server/src/binary/handlers/topics/purge_topic_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::topics::purge_topic::PurgeTopic; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] +#[instrument(skip_all, name = "trace_purge_topic", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] pub async fn handle( command: PurgeTopic, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/topics/update_topic_handler.rs b/server/src/binary/handlers/topics/update_topic_handler.rs index 33f5a62b2..2a67afe57 100644 --- a/server/src/binary/handlers/topics/update_topic_handler.rs +++ b/server/src/binary/handlers/topics/update_topic_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::topics::update_topic::UpdateTopic; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] +#[instrument(skip_all, name = "trace_update_topic", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id, iggy_stream_id = command.stream_id.as_string(), iggy_topic_id = command.topic_id.as_string()))] pub async fn handle( mut command: UpdateTopic, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/users/change_password_handler.rs b/server/src/binary/handlers/users/change_password_handler.rs index 700d1ef83..f141007f9 100644 --- a/server/src/binary/handlers/users/change_password_handler.rs +++ b/server/src/binary/handlers/users/change_password_handler.rs @@ -8,7 +8,7 @@ use iggy::error::IggyError; use iggy::users::change_password::ChangePassword; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_change_password", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: ChangePassword, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/users/create_user_handler.rs b/server/src/binary/handlers/users/create_user_handler.rs index b831d45d9..4dc9e23a5 100644 --- a/server/src/binary/handlers/users/create_user_handler.rs +++ b/server/src/binary/handlers/users/create_user_handler.rs @@ -9,7 +9,7 @@ use iggy::error::IggyError; use iggy::users::create_user::CreateUser; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_create_user", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: CreateUser, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/users/delete_user_handler.rs b/server/src/binary/handlers/users/delete_user_handler.rs index 678a276f1..73ab1ab0d 100644 --- a/server/src/binary/handlers/users/delete_user_handler.rs +++ b/server/src/binary/handlers/users/delete_user_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::users::delete_user::DeleteUser; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_delete_user", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: DeleteUser, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/users/login_user_handler.rs b/server/src/binary/handlers/users/login_user_handler.rs index 5c898831e..e992a7aa8 100644 --- a/server/src/binary/handlers/users/login_user_handler.rs +++ b/server/src/binary/handlers/users/login_user_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::users::login_user::LoginUser; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_login_user", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: LoginUser, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/users/logout_user_handler.rs b/server/src/binary/handlers/users/logout_user_handler.rs index 8867eb0f5..dbc7d37a2 100644 --- a/server/src/binary/handlers/users/logout_user_handler.rs +++ b/server/src/binary/handlers/users/logout_user_handler.rs @@ -6,7 +6,7 @@ use iggy::error::IggyError; use iggy::users::logout_user::LogoutUser; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_logout_user", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: LogoutUser, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/users/update_permissions_handler.rs b/server/src/binary/handlers/users/update_permissions_handler.rs index 85dd29aa5..c8f5da83f 100644 --- a/server/src/binary/handlers/users/update_permissions_handler.rs +++ b/server/src/binary/handlers/users/update_permissions_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::users::update_permissions::UpdatePermissions; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_update_permissions", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: UpdatePermissions, sender: &mut dyn Sender, diff --git a/server/src/binary/handlers/users/update_user_handler.rs b/server/src/binary/handlers/users/update_user_handler.rs index 712c9bc91..708cfe144 100644 --- a/server/src/binary/handlers/users/update_user_handler.rs +++ b/server/src/binary/handlers/users/update_user_handler.rs @@ -7,7 +7,7 @@ use iggy::error::IggyError; use iggy::users::update_user::UpdateUser; use tracing::{debug, instrument}; -#[instrument(skip_all, fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] +#[instrument(skip_all, name = "trace_update_user", fields(iggy_user_id = session.get_user_id(), iggy_client_id = session.client_id))] pub async fn handle( command: UpdateUser, sender: &mut dyn Sender, diff --git a/server/src/channels/commands/archive_state.rs b/server/src/channels/commands/archive_state.rs index 836f80a25..308f1a993 100644 --- a/server/src/channels/commands/archive_state.rs +++ b/server/src/channels/commands/archive_state.rs @@ -59,7 +59,7 @@ impl StateArchiver { #[async_trait] impl ServerCommand for ArchiveStateExecutor { - #[instrument(skip_all)] + #[instrument(skip_all, name = "trace_archive_state")] async fn execute(&mut self, system: &SharedSystem, command: ArchiveStateCommand) { let system = system.read().await; if system.archiver.is_none() { diff --git a/server/src/channels/commands/clean_personal_access_tokens.rs b/server/src/channels/commands/clean_personal_access_tokens.rs index bb1b3fb73..bbb4850f8 100644 --- a/server/src/channels/commands/clean_personal_access_tokens.rs +++ b/server/src/channels/commands/clean_personal_access_tokens.rs @@ -60,7 +60,7 @@ impl PersonalAccessTokenCleaner { #[async_trait] impl ServerCommand for CleanPersonalAccessTokensExecutor { - #[instrument(skip_all)] + #[instrument(skip_all, name = "trace_clean_personal_access_tokens")] async fn execute(&mut self, system: &SharedSystem, _command: CleanPersonalAccessTokensCommand) { // TODO: System write lock, investigate if it's necessary. let mut system = system.write().await; diff --git a/server/src/channels/commands/maintain_messages.rs b/server/src/channels/commands/maintain_messages.rs index 3f6b612cd..1d88cb6a2 100644 --- a/server/src/channels/commands/maintain_messages.rs +++ b/server/src/channels/commands/maintain_messages.rs @@ -77,7 +77,7 @@ impl MessagesMaintainer { #[async_trait] impl ServerCommand for MaintainMessagesExecutor { - #[instrument(skip_all)] + #[instrument(skip_all, name = "trace_maintain_messages")] async fn execute(&mut self, system: &SharedSystem, command: MaintainMessagesCommand) { let system = system.read().await; let streams = system.get_streams(); diff --git a/server/src/channels/commands/save_messages.rs b/server/src/channels/commands/save_messages.rs index 6c489a876..2da2ec289 100644 --- a/server/src/channels/commands/save_messages.rs +++ b/server/src/channels/commands/save_messages.rs @@ -58,7 +58,7 @@ impl MessagesSaver { #[async_trait] impl ServerCommand for SaveMessagesExecutor { - #[instrument(skip_all)] + #[instrument(skip_all, name = "trace_save_messages")] async fn execute(&mut self, system: &SharedSystem, _command: SaveMessagesCommand) { let saved_messages_count = system.read().await.persist_messages().await; match saved_messages_count { diff --git a/server/src/channels/commands/verify_heartbeats.rs b/server/src/channels/commands/verify_heartbeats.rs index 930b7f525..b3b073298 100644 --- a/server/src/channels/commands/verify_heartbeats.rs +++ b/server/src/channels/commands/verify_heartbeats.rs @@ -65,7 +65,7 @@ impl VerifyHeartbeats { #[async_trait] impl ServerCommand for VerifyHeartbeatsExecutor { - #[instrument(skip_all)] + #[instrument(skip_all, name = "trace_verify_heartbeats")] async fn execute(&mut self, system: &SharedSystem, command: VerifyHeartbeatsCommand) { let system = system.read().await; let clients; diff --git a/server/src/http/consumer_groups.rs b/server/src/http/consumer_groups.rs index 2bbc45be0..b82245292 100644 --- a/server/src/http/consumer_groups.rs +++ b/server/src/http/consumer_groups.rs @@ -71,7 +71,7 @@ async fn get_consumer_groups( Ok(Json(consumer_groups)) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] +#[instrument(skip_all, name = "trace_create_consumer_group", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] async fn create_consumer_group( State(state): State>, Extension(identity): Extension, @@ -106,7 +106,7 @@ async fn create_consumer_group( Ok((StatusCode::CREATED, Json(consumer_group_details))) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id, iggy_group_id = group_id))] +#[instrument(skip_all, name = "trace_delete_consumer_group", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id, iggy_group_id = group_id))] async fn delete_consumer_group( State(state): State>, Extension(identity): Extension, diff --git a/server/src/http/messages.rs b/server/src/http/messages.rs index 6c0769531..33e9e1c67 100644 --- a/server/src/http/messages.rs +++ b/server/src/http/messages.rs @@ -88,7 +88,7 @@ async fn send_messages( Ok(StatusCode::CREATED) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id, iggy_partition_id = partition_id, iggy_fsync = fsync))] +#[instrument(skip_all, name = "trace_flush_unsaved_buffer", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id, iggy_partition_id = partition_id, iggy_fsync = fsync))] async fn flush_unsaved_buffer( State(state): State>, Extension(identity): Extension, diff --git a/server/src/http/partitions.rs b/server/src/http/partitions.rs index 8a73a8646..b750ac464 100644 --- a/server/src/http/partitions.rs +++ b/server/src/http/partitions.rs @@ -23,7 +23,7 @@ pub fn router(state: Arc) -> Router { .with_state(state) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] +#[instrument(skip_all, name = "trace_create_partitions", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] async fn create_partitions( State(state): State>, Extension(identity): Extension, @@ -53,7 +53,7 @@ async fn create_partitions( Ok(StatusCode::CREATED) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] +#[instrument(skip_all, name = "trace_delete_partitions", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] async fn delete_partitions( State(state): State>, Extension(identity): Extension, diff --git a/server/src/http/personal_access_tokens.rs b/server/src/http/personal_access_tokens.rs index 6854ec0d9..4a6df1de8 100644 --- a/server/src/http/personal_access_tokens.rs +++ b/server/src/http/personal_access_tokens.rs @@ -49,7 +49,7 @@ async fn get_personal_access_tokens( Ok(Json(personal_access_tokens)) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id))] +#[instrument(skip_all, name = "trace_create_personal_access_token", fields(iggy_user_id = identity.user_id))] async fn create_personal_access_token( State(state): State>, Extension(identity): Extension, @@ -83,7 +83,7 @@ async fn create_personal_access_token( Ok(Json(RawPersonalAccessToken { token })) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id))] +#[instrument(skip_all, name = "trace_delete_personal_access_token", fields(iggy_user_id = identity.user_id))] async fn delete_personal_access_token( State(state): State>, Extension(identity): Extension, @@ -110,7 +110,7 @@ async fn delete_personal_access_token( Ok(StatusCode::NO_CONTENT) } -#[instrument(skip_all)] +#[instrument(skip_all, name = "trace_login_with_personal_access_token")] async fn login_with_personal_access_token( State(state): State>, Json(command): Json, diff --git a/server/src/http/streams.rs b/server/src/http/streams.rs index fbd2aad8c..c6f16d02e 100644 --- a/server/src/http/streams.rs +++ b/server/src/http/streams.rs @@ -60,7 +60,7 @@ async fn get_streams( Ok(Json(streams)) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id))] +#[instrument(skip_all, name = "trace_create_stream", fields(iggy_user_id = identity.user_id))] async fn create_stream( State(state): State>, Extension(identity): Extension, @@ -88,7 +88,7 @@ async fn create_stream( Ok(response) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id))] +#[instrument(skip_all, name = "trace_update_stream", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id))] async fn update_stream( State(state): State>, Extension(identity): Extension, @@ -116,7 +116,7 @@ async fn update_stream( Ok(StatusCode::NO_CONTENT) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id))] +#[instrument(skip_all, name = "trace_delete_stream", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id))] async fn delete_stream( State(state): State>, Extension(identity): Extension, @@ -144,7 +144,7 @@ async fn delete_stream( Ok(StatusCode::NO_CONTENT) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id))] +#[instrument(skip_all, name = "trace_purge_stream", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id))] async fn purge_stream( State(state): State>, Extension(identity): Extension, diff --git a/server/src/http/topics.rs b/server/src/http/topics.rs index b83c085eb..8552d49e7 100644 --- a/server/src/http/topics.rs +++ b/server/src/http/topics.rs @@ -71,7 +71,7 @@ async fn get_topics( Ok(Json(topics)) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id))] +#[instrument(skip_all, name = "trace_create_topic", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id))] async fn create_topic( State(state): State>, Extension(identity): Extension, @@ -109,7 +109,7 @@ async fn create_topic( Ok(response) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] +#[instrument(skip_all, name = "trace_update_topic", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] async fn update_topic( State(state): State>, Extension(identity): Extension, @@ -145,7 +145,7 @@ async fn update_topic( Ok(StatusCode::NO_CONTENT) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] +#[instrument(skip_all, name = "trace_delete_topic", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] async fn delete_topic( State(state): State>, Extension(identity): Extension, @@ -178,7 +178,7 @@ async fn delete_topic( Ok(StatusCode::NO_CONTENT) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] +#[instrument(skip_all, name = "trace_purge_topic", fields(iggy_user_id = identity.user_id, iggy_stream_id = stream_id, iggy_topic_id = topic_id))] async fn purge_topic( State(state): State>, Extension(identity): Extension, diff --git a/server/src/http/users.rs b/server/src/http/users.rs index 5a87a251a..45783e754 100644 --- a/server/src/http/users.rs +++ b/server/src/http/users.rs @@ -70,7 +70,7 @@ async fn get_users( Ok(Json(users)) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id))] +#[instrument(skip_all, name = "trace_create_user", fields(iggy_user_id = identity.user_id))] async fn create_user( State(state): State>, Extension(identity): Extension, @@ -110,7 +110,7 @@ async fn create_user( Ok(response) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_updated_user_id = user_id))] +#[instrument(skip_all, name = "trace_update_user", fields(iggy_user_id = identity.user_id, iggy_updated_user_id = user_id))] async fn update_user( State(state): State>, Extension(identity): Extension, @@ -139,7 +139,7 @@ async fn update_user( Ok(StatusCode::NO_CONTENT) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_updated_user_id = user_id))] +#[instrument(skip_all, name = "trace_update_permissions", fields(iggy_user_id = identity.user_id, iggy_updated_user_id = user_id))] async fn update_permissions( State(state): State>, Extension(identity): Extension, @@ -167,7 +167,7 @@ async fn update_permissions( Ok(StatusCode::NO_CONTENT) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_updated_user_id = user_id))] +#[instrument(skip_all, name = "trace_change_password", fields(iggy_user_id = identity.user_id, iggy_updated_user_id = user_id))] async fn change_password( State(state): State>, Extension(identity): Extension, @@ -204,7 +204,7 @@ async fn change_password( Ok(StatusCode::NO_CONTENT) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id, iggy_deleted_user_id = user_id))] +#[instrument(skip_all, name = "trace_delete_user", fields(iggy_user_id = identity.user_id, iggy_deleted_user_id = user_id))] async fn delete_user( State(state): State>, Extension(identity): Extension, @@ -232,7 +232,7 @@ async fn delete_user( Ok(StatusCode::NO_CONTENT) } -#[instrument(skip_all)] +#[instrument(skip_all, name = "trace_login_user")] async fn login_user( State(state): State>, Json(command): Json, @@ -246,7 +246,7 @@ async fn login_user( Ok(Json(map_generated_access_token_to_identity_info(tokens))) } -#[instrument(skip_all, fields(iggy_user_id = identity.user_id))] +#[instrument(skip_all, name = "trace_logout_user", fields(iggy_user_id = identity.user_id))] async fn logout_user( State(state): State>, Extension(identity): Extension, diff --git a/server/src/main.rs b/server/src/main.rs index 65bd92ec8..8d1fa81e0 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -25,7 +25,7 @@ use tokio::time::Instant; use tracing::{info, instrument}; #[tokio::main] -#[instrument(skip_all)] +#[instrument(skip_all, name = "trace_start_server")] async fn main() -> Result<(), ServerError> { let startup_timestamp = Instant::now(); let standard_font = FIGfont::standard().unwrap(); diff --git a/server/src/streaming/systems/system.rs b/server/src/streaming/systems/system.rs index 5f13e76f7..82344535b 100644 --- a/server/src/streaming/systems/system.rs +++ b/server/src/streaming/systems/system.rs @@ -175,7 +175,7 @@ impl System { } } - #[instrument(skip_all)] + #[instrument(skip_all, name = "trace_system_init")] pub async fn init(&mut self) -> Result<(), IggyError> { let system_path = self.config.get_system_path(); if !Path::new(&system_path).exists() && create_dir(&system_path).await.is_err() { @@ -233,13 +233,13 @@ impl System { Ok(()) } - #[instrument(skip_all)] + #[instrument(skip_all, name = "trace_shutdown")] pub async fn shutdown(&mut self) -> Result<(), IggyError> { self.persist_messages().await?; Ok(()) } - #[instrument(skip_all)] + #[instrument(skip_all, name = "trace_persist_messages")] pub async fn persist_messages(&self) -> Result { trace!("Saving buffered messages on disk..."); let mut saved_messages_number = 0;