@@ -17,6 +17,30 @@ const METRIC_RECORDS = Object.freeze([{
1717 help : 'Cloud Resource Types in the System' ,
1818 labelNames : [ 'type' , 'count' ]
1919 }
20+ } , {
21+ metric_type : 'Gauge' ,
22+ metric_variable : 'projects_capacity_usage' ,
23+ configuration : {
24+ name : get_metric_name ( 'projects_capacity_usage' ) ,
25+ help : 'Projects Capacity Usage' ,
26+ labelNames : [ 'project' , 'count' ]
27+ }
28+ } , {
29+ metric_type : 'Gauge' ,
30+ metric_variable : 'accounts_io_usage' ,
31+ configuration : {
32+ name : get_metric_name ( 'accounts_io_usage' ) ,
33+ help : 'Accounts I/O Usage' ,
34+ labelNames : [ 'account' , 'read_count' , 'write_count' ]
35+ }
36+ } , {
37+ metric_type : 'Gauge' ,
38+ metric_variable : 'bucket_class_capacity_usage' ,
39+ configuration : {
40+ name : get_metric_name ( 'bucket_class_capacity_usage' ) ,
41+ help : 'Bucket Class Capacity Usage' ,
42+ labelNames : [ 'bucket_class' , 'count' ]
43+ }
2044} , {
2145 metric_type : 'Gauge' ,
2246 metric_variable : 'unhealthy_cloud_types' ,
@@ -105,6 +129,22 @@ const METRIC_RECORDS = Object.freeze([{
105129 help : 'Objects On Object Bucket Claims' ,
106130 } ,
107131 generate_default_set : true ,
132+ } , {
133+ metric_type : 'Gauge' ,
134+ metric_variable : 'reduction_ratio' ,
135+ configuration : {
136+ name : get_metric_name ( 'reduction_ratio' ) ,
137+ help : 'Object Efficiency Ratio' ,
138+ } ,
139+ generate_default_set : true ,
140+ } , {
141+ metric_type : 'Gauge' ,
142+ metric_variable : 'object_savings' ,
143+ configuration : {
144+ name : get_metric_name ( 'object_savings' ) ,
145+ help : 'Object Savings' ,
146+ } ,
147+ generate_default_set : true ,
108148} ] ) ;
109149
110150
@@ -173,6 +213,31 @@ class PrometheusReporting {
173213 this . _metrics . unhealthy_cloud_types . set ( { type : 'S3_Compatible' } , types . unhealthy_cloud_pool_target . s3_comp_unhealthy ) ;
174214 }
175215
216+ set_bucket_class_capacity_usage ( usage_info ) {
217+ if ( ! this . enabled ( ) ) return ;
218+ this . _metrics . bucket_class_capacity_usage . reset ( ) ;
219+ for ( let [ key , value ] of Object . entries ( usage_info ) ) {
220+ this . _metrics . bucket_class_capacity_usage . set ( { bucket_class : key } , value ) ;
221+ }
222+ }
223+
224+ set_projects_capacity_usage ( usage_info ) {
225+ if ( ! this . enabled ( ) ) return ;
226+ this . _metrics . projects_capacity_usage . reset ( ) ;
227+ for ( let [ key , value ] of Object . entries ( usage_info ) ) {
228+ this . _metrics . projects_capacity_usage . set ( { project : key } , value ) ;
229+ }
230+ }
231+
232+ set_accounts_io_usage ( accounts_info ) {
233+ if ( ! this . enabled ( ) ) return ;
234+ this . _metrics . accounts_io_usage . reset ( ) ;
235+ accounts_info . accounts . forEach ( account_info => {
236+ const { account, read_count, write_count, read_write_bytes } = account_info ;
237+ this . _metrics . accounts_io_usage . set ( { account, read_count, write_count } , read_write_bytes ) ;
238+ } ) ;
239+ }
240+
176241 set_object_sizes ( sizes ) {
177242 if ( ! this . enabled ( ) ) return ;
178243 for ( const bin of sizes ) {
0 commit comments