File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
crates/application/src/snapshot_import Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 11use std:: time:: Duration ;
22
33use metrics:: {
4+ log_counter,
45 log_distribution,
6+ register_convex_counter,
57 register_convex_histogram,
68 StatusTimer ,
79 STATUS_LABEL ,
@@ -23,3 +25,11 @@ register_convex_histogram!(
2325pub fn log_snapshot_import_age ( age : Duration ) {
2426 log_distribution ( & SNAPSHOT_IMPORT_AGE_SECONDS , age. as_secs_f64 ( ) ) ;
2527}
28+
29+ register_convex_counter ! (
30+ SNAPSHOT_IMPORT_WORKER_DIED_TOTAL ,
31+ "Number of times the snapshot import worker died" ,
32+ ) ;
33+ pub fn log_snapshot_import_worker_died ( ) {
34+ log_counter ( & SNAPSHOT_IMPORT_WORKER_DIED_TOTAL , 1 ) ;
35+ }
Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ use usage_tracking::UsageCounter;
2222use crate :: {
2323 metrics:: log_worker_starting,
2424 snapshot_import:: {
25- metrics:: snapshot_import_timer,
25+ metrics:: {
26+ log_snapshot_import_worker_died,
27+ snapshot_import_timer,
28+ } ,
2629 SnapshotImportExecutor ,
2730 } ,
2831} ;
@@ -51,6 +54,7 @@ impl SnapshotImportWorker {
5154 async move {
5255 loop {
5356 if let Err ( e) = Self :: run_once ( & mut worker) . await {
57+ log_snapshot_import_worker_died ( ) ;
5458 report_error ( & mut e. context ( "SnapshotImportWorker died" ) ) . await ;
5559 let delay = worker. backoff . fail ( & mut worker. runtime . rng ( ) ) ;
5660 worker. runtime . wait ( delay) . await ;
You can’t perform that action at this time.
0 commit comments