Improve zebra-state logging and metrics

This commit is contained in:
teor 2020-09-02 11:20:32 +10:00 committed by Deirdre Connolly
parent 753b93d8a3
commit d3b6a73f7b
3 changed files with 6 additions and 0 deletions

1
Cargo.lock generated
View File

@ -3212,6 +3212,7 @@ dependencies = [
"futures",
"hex",
"lazy_static",
"metrics",
"once_cell",
"serde",
"sled",

View File

@ -18,6 +18,7 @@ serde = { version = "1", features = ["serde_derive"] }
sled = "0.34.3"
futures = "0.3.5"
metrics = "0.12"
tower = "0.3.1"
tracing = "0.1"
tracing-error = "0.1.2"

View File

@ -57,6 +57,10 @@ impl SledState {
Ok(())
})?;
tracing::trace!(?height, ?hash, "Committed block");
metrics::gauge!("state.committed.block.height", height.0 as _);
metrics::counter!("state.committed.block.count", 1);
Ok(hash)
}