@@ -44,12 +44,24 @@ pub static STORAGE_FILES_SCANNED: Lazy<CounterVec> = Lazy::new(|| {
44
44
. expect ( "metric can be created" )
45
45
} ) ;
46
46
47
+ pub static STORAGE_FILES_SCANNED_DATE : Lazy < CounterVec > = Lazy :: new ( || {
48
+ CounterVec :: new (
49
+ Opts :: new (
50
+ "storage_files_scanned_date_total" ,
51
+ "Total number of files scanned in storage operations by date" ,
52
+ )
53
+ . namespace ( METRICS_NAMESPACE ) ,
54
+ & [ "provider" , "operation" , "date" ] ,
55
+ )
56
+ . expect ( "metric can be created" )
57
+ } ) ;
58
+
47
59
pub trait StorageMetrics {
48
60
fn register_metrics ( & self , handler : & PrometheusMetrics ) ;
49
61
}
50
62
51
63
pub mod localfs {
52
- use crate :: storage:: FSConfig ;
64
+ use crate :: { metrics :: storage:: STORAGE_FILES_SCANNED_DATE , storage :: FSConfig } ;
53
65
54
66
use super :: { STORAGE_FILES_SCANNED , STORAGE_REQUEST_RESPONSE_TIME , StorageMetrics } ;
55
67
@@ -63,12 +75,16 @@ pub mod localfs {
63
75
. registry
64
76
. register ( Box :: new ( STORAGE_FILES_SCANNED . clone ( ) ) )
65
77
. expect ( "metric can be registered" ) ;
78
+ handler
79
+ . registry
80
+ . register ( Box :: new ( STORAGE_FILES_SCANNED_DATE . clone ( ) ) )
81
+ . expect ( "metric can be registered" ) ;
66
82
}
67
83
}
68
84
}
69
85
70
86
pub mod s3 {
71
- use crate :: storage:: S3Config ;
87
+ use crate :: { metrics :: storage:: STORAGE_FILES_SCANNED_DATE , storage :: S3Config } ;
72
88
73
89
use super :: { STORAGE_FILES_SCANNED , STORAGE_REQUEST_RESPONSE_TIME , StorageMetrics } ;
74
90
@@ -82,12 +98,16 @@ pub mod s3 {
82
98
. registry
83
99
. register ( Box :: new ( STORAGE_FILES_SCANNED . clone ( ) ) )
84
100
. expect ( "metric can be registered" ) ;
101
+ handler
102
+ . registry
103
+ . register ( Box :: new ( STORAGE_FILES_SCANNED_DATE . clone ( ) ) )
104
+ . expect ( "metric can be registered" ) ;
85
105
}
86
106
}
87
107
}
88
108
89
109
pub mod azureblob {
90
- use crate :: storage:: AzureBlobConfig ;
110
+ use crate :: { metrics :: storage:: STORAGE_FILES_SCANNED_DATE , storage :: AzureBlobConfig } ;
91
111
92
112
use super :: { STORAGE_FILES_SCANNED , STORAGE_REQUEST_RESPONSE_TIME , StorageMetrics } ;
93
113
@@ -101,12 +121,16 @@ pub mod azureblob {
101
121
. registry
102
122
. register ( Box :: new ( STORAGE_FILES_SCANNED . clone ( ) ) )
103
123
. expect ( "metric can be registered" ) ;
124
+ handler
125
+ . registry
126
+ . register ( Box :: new ( STORAGE_FILES_SCANNED_DATE . clone ( ) ) )
127
+ . expect ( "metric can be registered" ) ;
104
128
}
105
129
}
106
130
}
107
131
108
132
pub mod gcs {
109
- use crate :: storage:: GcsConfig ;
133
+ use crate :: { metrics :: storage:: STORAGE_FILES_SCANNED_DATE , storage :: GcsConfig } ;
110
134
111
135
use super :: { STORAGE_FILES_SCANNED , STORAGE_REQUEST_RESPONSE_TIME , StorageMetrics } ;
112
136
@@ -120,6 +144,10 @@ pub mod gcs {
120
144
. registry
121
145
. register ( Box :: new ( STORAGE_FILES_SCANNED . clone ( ) ) )
122
146
. expect ( "metric can be registered" ) ;
147
+ handler
148
+ . registry
149
+ . register ( Box :: new ( STORAGE_FILES_SCANNED_DATE . clone ( ) ) )
150
+ . expect ( "metric can be registered" ) ;
123
151
}
124
152
}
125
153
}
0 commit comments