diff --git a/beacon_node/http_server/Cargo.toml b/beacon_node/http_server/Cargo.toml index fb8bf9f4b..098c3e1c9 100644 --- a/beacon_node/http_server/Cargo.toml +++ b/beacon_node/http_server/Cargo.toml @@ -20,7 +20,7 @@ fork_choice = { path = "../../eth2/fork_choice" } grpcio = { version = "0.4", default-features = false, features = ["protobuf-codec"] } persistent = "^0.4" protobuf = "2.0.2" -prometheus = "^0.6" +prometheus = { version = "^0.6", features = ["process"] } clap = "2.32.0" store = { path = "../store" } dirs = "1.0.3" diff --git a/beacon_node/http_server/src/metrics.rs b/beacon_node/http_server/src/metrics.rs index 2c6cda0ea..bfa80ec55 100644 --- a/beacon_node/http_server/src/metrics.rs +++ b/beacon_node/http_server/src/metrics.rs @@ -90,9 +90,13 @@ fn handle_metrics(req: &mut Request) -> IronResul let validator_count = beacon_chain.head().beacon_state.validator_registry.len(); local_metrics.validator_count.set(validator_count as i64); - // Gather the metrics. let mut buffer = vec![]; let encoder = TextEncoder::new(); + + // Gather `DEFAULT_REGISTRY` metrics. + encoder.encode(&prometheus::gather(), &mut buffer).unwrap(); + + // Gather metrics from our registry. let metric_families = r.gather(); encoder.encode(&metric_families, &mut buffer).unwrap();