feat(metrics): add response metrics (#1263)

This commit is contained in:
Nishant Joshi
2023-05-25 15:04:13 +05:30
committed by GitHub
parent 5e90a369db
commit 4ebd26f27e
9 changed files with 134 additions and 19 deletions

View File

@ -25,13 +25,21 @@ where
Q: Serialize + std::fmt::Debug + 'a,
S: TryFrom<Q> + Serialize,
E: Serialize + error_stack::Context + actix_web::ResponseError + Clone,
U: auth::AuthInfo,
error_stack::Report<E>: services::EmbedError,
errors::ApiErrorResponse: ErrorSwitch<E>,
T: std::fmt::Debug,
A: AppStateInfo,
{
let resp: common_utils::errors::CustomResult<_, E> =
api::server_wrap_util(state, request, payload, func, api_authentication).await;
let resp: common_utils::errors::CustomResult<_, E> = api::server_wrap_util(
&router_env::Flow::CompatibilityLayerRequest,
state,
request,
payload,
func,
api_authentication,
)
.await;
match resp {
Ok(api::ApplicationResponse::Json(router_resp)) => {
let pg_resp = S::try_from(router_resp);