Skip to content

Commit

Permalink
Improve logging when ratelimit is exceeded
Browse files Browse the repository at this point in the history
Summary:
What the title says
This will help with filtering on scuba as  ratelimis will follow the same format wether tracked/enforced or dfferent metrics

Reviewed By: lmvasquezg

Differential Revision: D68896071

fbshipit-source-id: ee1687a05c8322d846045ae8ce9ffc66203e3bb6
  • Loading branch information
Clara Rull authored and facebook-github-bot committed Jan 31, 2025
1 parent 29a3487 commit f9677e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eden/mononoke/edenapi_service/src/utils/rate_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub async fn counter_check_and_bump<'a>(
count,
max_value,
);
let msg = format!("{}: Exceeded (log only)", rate_limit_name);
let msg = format!("Rate limit exceeded: {} (log only)", rate_limit_name);
scuba.log_with_msg(&msg, None);
Ok(())
} else {
Expand All @@ -92,7 +92,7 @@ pub async fn counter_check_and_bump<'a>(
count,
max_value,
);
let msg = format!("{}: Blocked", rate_limit_name);
let msg = format!("Rate limit exceeded: {} (enforced)", rate_limit_name);
scuba.log_with_msg(&msg, None);
Err(anyhow!(msg))
}
Expand Down

0 comments on commit f9677e6

Please sign in to comment.