diff --git a/services/identity/src/constants.rs b/services/identity/src/constants.rs --- a/services/identity/src/constants.rs +++ b/services/identity/src/constants.rs @@ -214,6 +214,7 @@ pub const SIWE_LOG: &str = "SIWE Error"; pub const GRPC_SERVICES_LOG: &str = "gRPC Services Error"; pub const TUNNELBROKER_LOG: &str = "Tunnelbroker Error"; + pub const HTTP_LOG: &str = "HTTP Error"; } // Tunnelbroker diff --git a/services/identity/src/http/handlers.rs b/services/identity/src/http/handlers.rs --- a/services/identity/src/http/handlers.rs +++ b/services/identity/src/http/handlers.rs @@ -1,3 +1,5 @@ +use crate::constants::error_types; + use super::{ errors::{create_error_response, http400, http404}, utils::{RequestExt, ResponseExt}, @@ -74,7 +76,10 @@ "invalid credentials", )), Err(err) => { - error!("CSAT verification error: {err:?}"); + error!( + errorType = error_types::HTTP_LOG, + "CSAT verification error: {err:?}" + ); Err(err.into()) } } diff --git a/services/identity/src/http/utils.rs b/services/identity/src/http/utils.rs --- a/services/identity/src/http/utils.rs +++ b/services/identity/src/http/utils.rs @@ -2,6 +2,8 @@ use std::collections::HashMap; use tracing::error; +use crate::constants::error_types; + use super::{ errors::{http500, BoxedError}, ErrorResponse, HttpRequest, HttpResponse, @@ -36,7 +38,10 @@ body: &T, ) -> Result { let json_string = serde_json::to_string(&body).map_err(|err| { - error!("JSON serialization error: {err:?}"); + error!( + errorType = error_types::HTTP_LOG, + "JSON serialization error: {err:?}" + ); http500() })?; let response = Response::builder() diff --git a/services/terraform/remote/aws_cloudwatch_alarms.tf b/services/terraform/remote/aws_cloudwatch_alarms.tf --- a/services/terraform/remote/aws_cloudwatch_alarms.tf +++ b/services/terraform/remote/aws_cloudwatch_alarms.tf @@ -12,6 +12,7 @@ GrpcServices = { name = "GrpcServices", pattern = "gRPC Services Error" }, Siwe = { name = "Siwe", pattern = "SIWE Error" }, Tunnelbroker = { name = "Tunnelbroker", pattern = "Tunnelbroker Error" } + Http = { name = "HTTP", pattern = "HTTP Error" } } }