Skip to content

Commit

Permalink
webapp: Fix path aggregation for monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Jan 28, 2025
1 parent 08cdf80 commit 9186b1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions repology-webapp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ async fn track_metrics(matched_path: MatchedPath, req: Request, next: Next) -> i

let path_for_metrics = {
// normalize some paths which lead to the same endpoints; XXX this will hopefully be gone
// someday when endpoints are redesigned (e.g. /projects/:bound/ → /projects/?start=)
// someday when endpoints are redesigned (e.g. /projects/{bound}/ → /projects/?start=)
let mut path = matched_path
.as_str()
.trim_end_matches(":bound/")
.trim_end_matches("/:sorting");
.trim_end_matches("{bound}/")
.trim_end_matches("/{sorting}");
if path.starts_with("/graph/total/") {
path = "/graph/total/..."
}
Expand Down

0 comments on commit 9186b1c

Please # to comment.