aboutsummaryrefslogtreecommitdiff
path: root/src/model/block_metrics.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-02-25 20:42:56 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-14 11:41:20 +0100
commitfe62d01b7efd878d291d9830f530c769eeeb62ec (patch)
tree1a04828b9d00e0757a57ec3eb55732f79adfecc4 /src/model/block_metrics.rs
parentbfb4353df50f31fc3b00a9833c09b8de16b471fc (diff)
downloadgarage-fe62d01b7efd878d291d9830f530c769eeeb62ec.tar.gz
garage-fe62d01b7efd878d291d9830f530c769eeeb62ec.zip
Implement exponential backoff for resync retriesfeature/opentelemetrybug/resync-exponential-backoff
Diffstat (limited to 'src/model/block_metrics.rs')
-rw-r--r--src/model/block_metrics.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/model/block_metrics.rs b/src/model/block_metrics.rs
index 819af241..f0f541a3 100644
--- a/src/model/block_metrics.rs
+++ b/src/model/block_metrics.rs
@@ -5,6 +5,7 @@ use garage_util::sled_counter::SledCountedTree;
/// TableMetrics reference all counter used for metrics
pub struct BlockManagerMetrics {
pub(crate) _resync_queue_len: ValueObserver<u64>,
+ pub(crate) _resync_errored_blocks: ValueObserver<u64>,
pub(crate) resync_counter: BoundCounter<u64>,
pub(crate) resync_error_counter: BoundCounter<u64>,
@@ -22,7 +23,7 @@ pub struct BlockManagerMetrics {
}
impl BlockManagerMetrics {
- pub fn new(resync_queue: SledCountedTree) -> Self {
+ pub fn new(resync_queue: SledCountedTree, resync_errors: SledCountedTree) -> Self {
let meter = global::meter("garage_model/block");
Self {
_resync_queue_len: meter
@@ -33,6 +34,12 @@ impl BlockManagerMetrics {
"Number of block hashes queued for local check and possible resync",
)
.init(),
+ _resync_errored_blocks: meter
+ .u64_value_observer("block.resync_errored_blocks", move |observer| {
+ observer.observe(resync_errors.len() as u64, &[])
+ })
+ .with_description("Number of block hashes whose last resync resulted in an error")
+ .init(),
resync_counter: meter
.u64_counter("block.resync_counter")