Skip to content

Commit

Permalink
Fix rest api instrumentation order
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsnaps committed Dec 21, 2023
1 parent 6f92ad6 commit d2eccf8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions limitador-server/src/http_api/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ async fn status() -> web::Json<()> {
Json(())
}

#[api_v2_operation]
#[tracing::instrument(skip(data))]
#[api_v2_operation]
async fn metrics(data: web::Data<Arc<Limiter>>) -> String {
match data.get_ref().as_ref() {
Limiter::Blocking(limiter) => limiter.gather_prometheus_metrics(),
Expand All @@ -68,8 +68,8 @@ async fn get_limits(
Ok(Json(resp_limits))
}

#[api_v2_operation]
#[tracing::instrument(skip(data))]
#[api_v2_operation]
async fn get_counters(
data: web::Data<Arc<Limiter>>,
namespace: web::Path<String>,
Expand All @@ -92,8 +92,8 @@ async fn get_counters(
}
}

#[api_v2_operation]
#[tracing::instrument(skip(state))]
#[api_v2_operation]
async fn check(
state: web::Data<Arc<Limiter>>,
request: web::Json<CheckAndReportInfo>,
Expand Down Expand Up @@ -121,8 +121,8 @@ async fn check(
}
}

#[api_v2_operation]
#[tracing::instrument(skip(data))]
#[api_v2_operation]
async fn report(
data: web::Data<Arc<Limiter>>,
request: web::Json<CheckAndReportInfo>,
Expand All @@ -144,8 +144,8 @@ async fn report(
}
}

#[api_v2_operation]
#[tracing::instrument(skip(data))]
#[api_v2_operation]
async fn check_and_report(
data: web::Data<Arc<Limiter>>,
request: web::Json<CheckAndReportInfo>,
Expand Down

0 comments on commit d2eccf8

Please sign in to comment.