Use global prometheus gather at rest api
This commit is contained in:
parent
e33d0703ef
commit
36ff115b04
@ -116,7 +116,3 @@ lazy_static! {
|
|||||||
pub static ref FORK_CHOICE_TIMES: Result<Histogram> =
|
pub static ref FORK_CHOICE_TIMES: Result<Histogram> =
|
||||||
register_histogram!("fork_choice_time", "Full runtime of fork choice");
|
register_histogram!("fork_choice_time", "Full runtime of fork choice");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn gather_metrics() -> Vec<prometheus::proto::MetricFamily> {
|
|
||||||
prometheus::gather()
|
|
||||||
}
|
|
||||||
|
@ -7,9 +7,7 @@ pub fn get_prometheus(_req: Request<Body>) -> ApiResult {
|
|||||||
let mut buffer = vec![];
|
let mut buffer = vec![];
|
||||||
let encoder = TextEncoder::new();
|
let encoder = TextEncoder::new();
|
||||||
|
|
||||||
encoder
|
encoder.encode(&prometheus::gather(), &mut buffer).unwrap();
|
||||||
.encode(&beacon_chain::gather_metrics(), &mut buffer)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
String::from_utf8(buffer)
|
String::from_utf8(buffer)
|
||||||
.map(|string| success_response(Body::from(string)))
|
.map(|string| success_response(Body::from(string)))
|
||||||
|
Loading…
Reference in New Issue
Block a user