File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
crates/application/src/exports Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
use metrics:: {
2
2
register_convex_histogram,
3
+ StaticMetricLabel ,
3
4
StatusTimer ,
4
- STATUS_LABEL ,
5
5
} ;
6
6
7
7
register_convex_histogram ! (
8
8
SNAPSHOT_EXPORT_TIMER_SECONDS ,
9
9
"Time taken for a snapshot export" ,
10
- & STATUS_LABEL
10
+ & [ "instance_name" , "status" ]
11
11
) ;
12
- pub fn export_timer ( ) -> StatusTimer {
13
- StatusTimer :: new ( & SNAPSHOT_EXPORT_TIMER_SECONDS )
12
+ pub fn export_timer ( instance_name : & str ) -> StatusTimer {
13
+ let mut timer = StatusTimer :: new ( & SNAPSHOT_EXPORT_TIMER_SECONDS ) ;
14
+ timer. add_label ( StaticMetricLabel :: new (
15
+ "instance_name" ,
16
+ instance_name. to_owned ( ) ,
17
+ ) ) ;
18
+ timer
14
19
}
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ impl<RT: Runtime> ExportWorker<RT> {
131
131
( Some ( export) , None ) => {
132
132
tracing:: info!( "Export requested." ) ;
133
133
let _status = log_worker_starting ( "ExportWorker" ) ;
134
- let timer = export_timer ( ) ;
134
+ let timer = export_timer ( & self . instance_name ) ;
135
135
let ts = self . database . now_ts_for_reads ( ) ;
136
136
let in_progress_export = ( * export) . clone ( ) . in_progress ( * ts) ?;
137
137
let in_progress_export_doc = SystemMetadataModel :: new_global ( & mut tx)
@@ -151,7 +151,7 @@ impl<RT: Runtime> ExportWorker<RT> {
151
151
( None , Some ( export) ) => {
152
152
tracing:: info!( "In progress export restarting..." ) ;
153
153
let _status = log_worker_starting ( "ExportWorker" ) ;
154
- let timer = export_timer ( ) ;
154
+ let timer = export_timer ( & self . instance_name ) ;
155
155
self . export ( export) . await ?;
156
156
timer. finish ( ) ;
157
157
return Ok ( ( ) ) ;
You can’t perform that action at this time.
0 commit comments