Skip to content

Commit

Permalink
Fix metrics formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Sep 15, 2020
1 parent 61f9d6c commit 9a5a265
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions beacon_node/http_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub fn prometheus_metrics() -> warp::filters::log::Log<impl Fn(warp::filters::lo
// a block hash).
let path = {
let equals = |s: &'static str| -> Option<&'static str> {
if info.path() == &format!("{}/{}/{}", API_PREFIX, API_VERSION, s) {
if info.path() == &format!("/{}/{}/{}", API_PREFIX, API_VERSION, s) {
Some(s)
} else {
None
Expand All @@ -127,7 +127,7 @@ pub fn prometheus_metrics() -> warp::filters::log::Log<impl Fn(warp::filters::lo
let starts_with = |s: &'static str| -> Option<&'static str> {
if info
.path()
.starts_with(&format!("{}/{}/{}", API_PREFIX, API_VERSION, s))
.starts_with(&format!("/{}/{}/{}", API_PREFIX, API_VERSION, s))
{
Some(s)
} else {
Expand Down Expand Up @@ -158,7 +158,7 @@ pub fn prometheus_metrics() -> warp::filters::log::Log<impl Fn(warp::filters::lo
);
metrics::observe_timer_vec(
&metrics::HTTP_API_PATHS_TIMES_TOTAL,
&[info.path()],
&[path],
info.elapsed(),
);
})
Expand Down

0 comments on commit 9a5a265

Please sign in to comment.