From 0de9c48b323c72e36c8cb391fbb044cdfcef333b Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Sat, 30 Dec 2023 17:27:11 -0300 Subject: [PATCH 1/2] chore: restore prometheus metrics in v2 --- Cargo.lock | 208 ++++++++++++++++++++++++----------- Cargo.toml | 6 +- examples/metrics/.gitignore | 1 + examples/metrics/daemon.toml | 12 ++ src/bin/oura/daemon.rs | 54 +++++++-- src/bin/oura/main.rs | 1 + src/bin/oura/prometheus.rs | 103 +++++++++++++++++ src/sources/n2c.rs | 15 ++- src/sources/n2n.rs | 16 ++- src/sources/utxorpc.rs | 7 ++ 10 files changed, 345 insertions(+), 78 deletions(-) create mode 100644 examples/metrics/.gitignore create mode 100644 examples/metrics/daemon.toml create mode 100644 src/bin/oura/prometheus.rs diff --git a/Cargo.lock b/Cargo.lock index a3ab3121..4bc02713 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -236,12 +236,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "ascii" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" - [[package]] name = "asn1-rs" version = "0.5.2" @@ -488,6 +482,17 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -848,11 +853,11 @@ dependencies = [ "http", "http-body 0.4.6", "hyper 0.14.28", - "hyper-rustls", + "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", "pin-utils", - "rustls", + "rustls 0.21.10", "tokio", "tracing", ] @@ -1191,12 +1196,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "chunked_transfer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" - [[package]] name = "cipher" version = "0.4.4" @@ -2177,7 +2176,7 @@ checksum = "0b8d622d1a59b48192258274bf58a5a6f44d4a0497fc8c4396c1a37759385417" dependencies = [ "deno_core", "once_cell", - "rustls", + "rustls 0.21.10", "rustls-native-certs", "rustls-pemfile", "rustls-webpki 0.101.7", @@ -2249,7 +2248,7 @@ dependencies = [ "once_cell", "serde", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -2593,6 +2592,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + [[package]] name = "env_logger" version = "0.10.1" @@ -3280,6 +3292,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.3" @@ -3425,6 +3446,21 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +dependencies = [ + "http", + "hyper 0.14.28", + "log", + "rustls 0.20.9", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.23.4", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -3435,10 +3471,10 @@ dependencies = [ "http", "hyper 0.14.28", "log", - "rustls", + "rustls 0.21.10", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -3611,7 +3647,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.3", "libc", "windows-sys 0.48.0", ] @@ -3652,7 +3688,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.3", "rustix 0.38.28", "windows-sys 0.52.0", ] @@ -4211,6 +4247,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.4" @@ -4242,6 +4292,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -4263,6 +4322,18 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.17" @@ -4279,7 +4350,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.3", "libc", ] @@ -4386,6 +4457,7 @@ dependencies = [ name = "oura" version = "2.0.0-alpha.2" dependencies = [ + "anyhow", "async-trait", "aws-config", "aws-sdk-lambda", @@ -4398,7 +4470,7 @@ dependencies = [ "crossterm", "deno_runtime", "elasticsearch", - "env_logger", + "env_logger 0.10.1", "file-rotate", "futures", "gasket", @@ -4416,7 +4488,7 @@ dependencies = [ "net2", "openssl", "pallas", - "prometheus_exporter", + "prometheus_exporter_base", "r2d2_redis", "reqwest", "serde", @@ -5073,29 +5145,21 @@ dependencies = [ ] [[package]] -name = "prometheus" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" -dependencies = [ - "cfg-if 1.0.0", - "fnv", - "lazy_static", - "memchr", - "parking_lot", - "thiserror", -] - -[[package]] -name = "prometheus_exporter" -version = "0.8.5" +name = "prometheus_exporter_base" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf17cbebe0bfdf4f279ef84eeefe0d50468b0b7116f078acf41d456e48fe81a" +checksum = "e42dafed8b073871c93f6082ff0fc597dbf26fb58974f0140f2c6a46c9f9f624" dependencies = [ - "ascii", - "prometheus", + "base64 0.13.1", + "env_logger 0.9.3", + "http", + "hyper 0.14.28", + "hyper-rustls 0.23.2", + "log", + "num", + "serde", + "serde_json", "thiserror", - "tiny_http", ] [[package]] @@ -5346,7 +5410,7 @@ dependencies = [ "http", "http-body 0.4.6", "hyper 0.14.28", - "hyper-rustls", + "hyper-rustls 0.24.2", "hyper-tls", "ipnet", "js-sys", @@ -5357,7 +5421,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.10", "rustls-pemfile", "serde", "serde_json", @@ -5365,7 +5429,7 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-socks", "tokio-util", "tower-service", @@ -5548,6 +5612,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct", + "webpki", +] + [[package]] name = "rustls" version = "0.21.10" @@ -5567,7 +5643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25da151615461c7347114b1ad1a7458b4cdebc69cb220cd140cd5cb324b1dd37" dependencies = [ "log", - "rustls", + "rustls 0.21.10", "rustls-native-certs", "rustls-webpki 0.101.7", ] @@ -6737,19 +6813,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tiny_http" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f8734c6d6943ad6df6b588d228a87b4af184998bcffa268ceddf05c2055a8c" -dependencies = [ - "ascii", - "chunked_transfer", - "log", - "time", - "url", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -6838,13 +6901,24 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.9", + "tokio", + "webpki", +] + [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.10", "tokio", ] @@ -6936,7 +7010,7 @@ dependencies = [ "rustls-native-certs", "rustls-pemfile", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-stream", "tower", "tower-layer", @@ -7527,6 +7601,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", +] + [[package]] name = "webpki-roots" version = "0.23.1" diff --git a/Cargo.toml b/Cargo.toml index 77321c31..aa26a013 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,14 +47,15 @@ serde = { version = "1.0.152", features = ["derive"] } serde_json = { version = "1.0.104", features = ["arbitrary_precision"] } strum = "0.24" strum_macros = "0.25" -prometheus_exporter = { version = "0.8.5", default-features = false } +prometheus_exporter_base = { version = "1.4.0", features = ["hyper", "hyper_server"] } unicode-truncate = "0.2.0" thiserror = "1.0.39" indicatif = "0.17.3" lazy_static = "1.4.0" tracing = "0.1.37" tracing-subscriber = "0.3.17" -tokio = { version = "1", features = ["rt"] } +anyhow = "1.0.77" +tokio = { version = "1", features = ["rt", "rt-multi-thread"] } async-trait = "0.1.68" elasticsearch = { version = "8.5.0-alpha.1", optional = true } murmur3 = { version = "0.5.2", optional = true } @@ -72,6 +73,7 @@ file-rotate = { version = "0.7.5", optional = true } tonic = { version = "0.9.2", features = ["tls", "tls-roots"], optional = true } futures = { version = "0.3.28", optional = true } + # aws aws-config = { version = "^1.1", optional = true } aws-types = { version = "^1.1", optional = true } diff --git a/examples/metrics/.gitignore b/examples/metrics/.gitignore new file mode 100644 index 00000000..94a2dd14 --- /dev/null +++ b/examples/metrics/.gitignore @@ -0,0 +1 @@ +*.json \ No newline at end of file diff --git a/examples/metrics/daemon.toml b/examples/metrics/daemon.toml new file mode 100644 index 00000000..347dd8d9 --- /dev/null +++ b/examples/metrics/daemon.toml @@ -0,0 +1,12 @@ +[source] +type = "N2N" +peers = ["relays-new.cardano-mainnet.iohk.io:3001"] + +[intersect] +type = "Point" +value = [4493860, "ce7f821d2140419fea1a7900cf71b0c0a0e94afbb1f814a6717cff071c3b6afc"] + +[sink] +type = "Noop" + +[metrics] diff --git a/src/bin/oura/daemon.rs b/src/bin/oura/daemon.rs index 337fa3c1..81171fbc 100644 --- a/src/bin/oura/daemon.rs +++ b/src/bin/oura/daemon.rs @@ -1,10 +1,10 @@ use gasket::runtime::Tether; use oura::{cursor, filters, framework::*, sinks, sources}; use serde::Deserialize; -use std::time::Duration; +use std::{fmt::Debug, sync::Arc, time::Duration}; use tracing::{info, warn}; -use crate::console; +use crate::{console, prometheus}; #[derive(Deserialize)] struct ConfigRoot { @@ -16,6 +16,7 @@ struct ConfigRoot { chain: Option, retries: Option, cursor: Option, + metrics: Option, } impl ConfigRoot { @@ -40,15 +41,21 @@ impl ConfigRoot { } } -struct Runtime { - source: Tether, - filters: Vec, - sink: Tether, - cursor: Tether, +pub struct Runtime { + pub source: Tether, + pub filters: Vec, + pub sink: Tether, + pub cursor: Tether, +} + +impl Debug for Runtime { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Runtime").finish() + } } impl Runtime { - fn all_tethers(&self) -> impl Iterator { + pub fn all_tethers(&self) -> impl Iterator { std::iter::once(&self.source) .chain(self.filters.iter()) .chain(std::iter::once(&self.sink)) @@ -132,6 +139,24 @@ fn bootstrap( Ok(runtime) } +async fn monitor_loop( + runtime: &Arc, + metrics: Option, + console: Option, +) { + if let Some(metrics) = metrics { + info!("starting metrics exporter"); + let runtime = runtime.clone(); + tokio::spawn(async { prometheus::initialize(metrics, runtime).await }); + } + + while !runtime.should_stop() { + // TODO: move console refresh to it's own tokio thread + console::refresh(&console, runtime.all_tethers()); + tokio::time::sleep(Duration::from_millis(1500)).await; + } +} + pub fn run(args: &Args) -> Result<(), Error> { console::initialize(&args.console); @@ -167,15 +192,20 @@ pub fn run(args: &Args) -> Result<(), Error> { let retries = define_gasket_policy(config.retries.as_ref()); let runtime = bootstrap(source, filters, sink, cursor, retries)?; + let runtime = Arc::new(runtime); + + let tokio_rt = tokio::runtime::Builder::new_multi_thread() + .enable_io() + .enable_time() + .build() + .unwrap(); info!("oura is running..."); - while !runtime.should_stop() { - console::refresh(&args.console, runtime.all_tethers()); - std::thread::sleep(Duration::from_millis(1500)); - } + tokio_rt.block_on(async { monitor_loop(&runtime, config.metrics, args.console.clone()).await }); info!("Oura is stopping..."); + runtime.shutdown(); Ok(()) diff --git a/src/bin/oura/main.rs b/src/bin/oura/main.rs index 24420043..ea540716 100644 --- a/src/bin/oura/main.rs +++ b/src/bin/oura/main.rs @@ -3,6 +3,7 @@ use std::process; mod console; mod daemon; +mod prometheus; #[derive(Parser)] #[clap(name = "Oura")] diff --git a/src/bin/oura/prometheus.rs b/src/bin/oura/prometheus.rs new file mode 100644 index 00000000..92e1a1e0 --- /dev/null +++ b/src/bin/oura/prometheus.rs @@ -0,0 +1,103 @@ +//! An utility to keep track of the progress of the pipeline as a whole + +use anyhow::{Context, Result}; +use gasket::{metrics::Reading, runtime::Tether}; +use prometheus_exporter_base::{ + prelude::{Authorization, ServerOptions}, + render_prometheus, MetricType, PrometheusInstance, PrometheusMetric, +}; +use serde::{Deserialize, Serialize}; +use std::{ + io::{BufWriter, Write}, + net::SocketAddr, + sync::Arc, +}; +use tracing::warn; + +use crate::daemon::Runtime; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Config { + pub address: Option, +} + +pub fn render_tether(tether: &Tether, render: &mut impl Write) -> Result<()> { + let readings = tether.read_metrics()?; + + let stage = tether.name(); + + let ts = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH)? + .as_millis(); + + for (name, value) in readings { + let full_name = format!("{stage}_{name}"); + + let metric_type = match value { + Reading::Count(_) => MetricType::Counter, + Reading::Gauge(_) => MetricType::Gauge, + Reading::Message(_) => MetricType::Summary, + }; + + let mut pc = PrometheusMetric::build() + .with_name(&full_name) + .with_help("some specific help") + .with_metric_type(metric_type) + .build(); + + match value { + Reading::Count(x) => { + pc.render_and_append_instance( + &PrometheusInstance::new().with_value(x).with_timestamp(ts), + ); + } + Reading::Gauge(x) => { + pc.render_and_append_instance( + &PrometheusInstance::new().with_value(x).with_timestamp(ts), + ); + } + Reading::Message(msg) => { + warn!(msg, "can't render message metrics to prometheous"); + } + }; + + writeln!(render, "{}", pc.render())?; + } + + Ok(()) +} + +fn render(runtime: &Runtime) -> Result { + warn!("rendering"); + let mut buf = BufWriter::new(Vec::new()); + + runtime + .all_tethers() + .try_for_each(|x| render_tether(x, &mut buf))?; + + let bytes = buf.into_inner()?; + let string = String::from_utf8(bytes)?; + + Ok(string) +} + +pub async fn initialize(config: Config, runtime: Arc) -> Result<()> { + let addr: SocketAddr = config + .address + .as_deref() + .unwrap_or("0.0.0.0:9186") + .parse() + .context("parsing binding config")?; + + let server_options = ServerOptions { + addr, + authorization: Authorization::None, + }; + + render_prometheus(server_options, runtime, |_, options| async move { + Ok(render(&options).unwrap()) + }) + .await; + + Ok(()) +} diff --git a/src/sources/n2c.rs b/src/sources/n2c.rs index ade9ea78..804e9c81 100644 --- a/src/sources/n2c.rs +++ b/src/sources/n2c.rs @@ -13,7 +13,7 @@ use crate::framework::*; #[derive(Stage)] #[stage( - name = "source-n2c", + name = "source", unit = "NextResponse", worker = "Worker" )] @@ -33,6 +33,12 @@ pub struct Stage { #[metric] chain_tip: gasket::metrics::Gauge, + + #[metric] + current_slot: gasket::metrics::Gauge, + + #[metric] + rollback_count: gasket::metrics::Counter, } async fn intersect_from_config( @@ -104,6 +110,8 @@ impl Worker { stage.breadcrumbs.track(point.clone()); stage.chain_tip.set(tip.0.slot_or_default() as i64); + stage.current_slot.set(slot as i64); + stage.ops_count.inc(1); Ok(()) } @@ -122,6 +130,9 @@ impl Worker { stage.breadcrumbs.track(point.clone()); stage.chain_tip.set(tip.0.slot_or_default() as i64); + stage.current_slot.set(point.slot_or_default() as i64); + stage.rollback_count.inc(1); + stage.ops_count.inc(1); Ok(()) } @@ -203,6 +214,8 @@ impl Config { output: Default::default(), ops_count: Default::default(), chain_tip: Default::default(), + current_slot: Default::default(), + rollback_count: Default::default(), }; Ok(stage) diff --git a/src/sources/n2n.rs b/src/sources/n2n.rs index aa6e5d5a..4657bf8a 100644 --- a/src/sources/n2n.rs +++ b/src/sources/n2n.rs @@ -11,7 +11,7 @@ use crate::framework::*; #[derive(Stage)] #[stage( - name = "source-n2n", + name = "source", unit = "NextResponse", worker = "Worker" )] @@ -31,6 +31,12 @@ pub struct Stage { #[metric] chain_tip: gasket::metrics::Gauge, + + #[metric] + current_slot: gasket::metrics::Gauge, + + #[metric] + rollback_count: gasket::metrics::Counter, } fn to_traverse(header: &HeaderContent) -> Result, WorkerError> { @@ -100,6 +106,7 @@ impl Worker { let header = to_traverse(header).or_panic()?; let slot = header.slot(); let hash = header.hash(); + let num = header.number(); let point = Point::Specific(slot, hash.to_vec()); debug!(slot, %hash, "chain sync roll forward"); @@ -121,6 +128,8 @@ impl Worker { stage.breadcrumbs.track(point); stage.chain_tip.set(tip.0.slot_or_default() as i64); + stage.current_slot.set(slot as i64); + stage.ops_count.inc(1); Ok(()) } @@ -139,6 +148,9 @@ impl Worker { stage.breadcrumbs.track(point.clone()); stage.chain_tip.set(tip.0.slot_or_default() as i64); + stage.current_slot.set(point.slot_or_default() as i64); + stage.ops_count.inc(1); + stage.rollback_count.inc(1); Ok(()) } @@ -227,7 +239,9 @@ impl Config { intersect: ctx.intersect.clone(), output: Default::default(), ops_count: Default::default(), + rollback_count: Default::default(), chain_tip: Default::default(), + current_slot: Default::default(), }; Ok(stage) diff --git a/src/sources/utxorpc.rs b/src/sources/utxorpc.rs index f5bffd96..cdcdadac 100644 --- a/src/sources/utxorpc.rs +++ b/src/sources/utxorpc.rs @@ -230,11 +230,17 @@ pub struct Stage { config: Config, breadcrumbs: Breadcrumbs, intersect: IntersectConfig, + pub output: SourceOutputPort, + #[metric] ops_count: gasket::metrics::Counter, + #[metric] chain_tip: gasket::metrics::Gauge, + + #[metric] + current_slot: gasket::metrics::Gauge, } #[derive(Deserialize)] @@ -252,6 +258,7 @@ impl Config { output: Default::default(), ops_count: Default::default(), chain_tip: Default::default(), + current_slot: Default::default(), }; Ok(stage) From 0a2841274dfe5c8cf2af51d8f17831b5eda5a9cb Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Sat, 30 Dec 2023 17:47:58 -0300 Subject: [PATCH 2/2] fix lint --- src/sources/n2n.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sources/n2n.rs b/src/sources/n2n.rs index 4657bf8a..5c6bd967 100644 --- a/src/sources/n2n.rs +++ b/src/sources/n2n.rs @@ -106,7 +106,6 @@ impl Worker { let header = to_traverse(header).or_panic()?; let slot = header.slot(); let hash = header.hash(); - let num = header.number(); let point = Point::Specific(slot, hash.to_vec()); debug!(slot, %hash, "chain sync roll forward");