File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ lazy_static! {
40
40
. expect( "metric can be created" ) ;
41
41
pub static ref STORAGE_SIZE : IntGaugeVec = IntGaugeVec :: new(
42
42
Opts :: new( "storage_size" , "Storage size bytes" ) . namespace( METRICS_NAMESPACE ) ,
43
- & [ "stream" , "format" ]
43
+ & [ "type" , " stream", "format" ]
44
44
)
45
45
. expect( "metric can be created" ) ;
46
46
pub static ref STAGING_FILES : IntGaugeVec = IntGaugeVec :: new(
@@ -117,7 +117,7 @@ pub fn load_from_global_stats() {
117
117
. with_label_values ( & [ & stream_name, "json" ] )
118
118
. set ( stats. ingestion as i64 ) ;
119
119
STORAGE_SIZE
120
- . with_label_values ( & [ & stream_name, "parquet" ] )
120
+ . with_label_values ( & [ "data" , & stream_name, "parquet" ] )
121
121
. set ( stats. storage as i64 )
122
122
}
123
123
}
Original file line number Diff line number Diff line change @@ -268,6 +268,15 @@ pub trait ObjectStorage: Sync + 'static {
268
268
. with_label_values ( & [ stream] )
269
269
. set ( files. len ( ) as i64 ) ;
270
270
271
+ for file in & files {
272
+ let file_size = file. metadata ( ) . unwrap ( ) . len ( ) ;
273
+ let file_type = file. extension ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
274
+
275
+ STORAGE_SIZE
276
+ . with_label_values ( & [ "staging" , stream, file_type] )
277
+ . add ( file_size as i64 ) ;
278
+ }
279
+
271
280
let record_reader = MergedRecordReader :: try_new ( & files) . unwrap ( ) ;
272
281
273
282
let mut parquet_table = CACHED_FILES . lock ( ) . unwrap ( ) ;
@@ -355,7 +364,7 @@ pub trait ObjectStorage: Sync + 'static {
355
364
let stats = STREAM_INFO . read ( ) . unwrap ( ) . get ( stream) . map ( |metadata| {
356
365
metadata. stats . add_storage_size ( compressed_size) ;
357
366
STORAGE_SIZE
358
- . with_label_values ( & [ stream, "parquet" ] )
367
+ . with_label_values ( & [ "data" , stream, "parquet" ] )
359
368
. add ( compressed_size as i64 ) ;
360
369
Stats :: from ( & metadata. stats )
361
370
} ) ;
You can’t perform that action at this time.
0 commit comments