1616
1717use once_cell:: sync:: Lazy ;
1818use quickwit_common:: metrics:: {
19- GaugeGuard , Histogram , IntCounter , IntCounterVec , IntGauge , new_counter, new_counter_vec,
19+ GaugeGuard , HistogramVec , IntCounter , IntCounterVec , IntGauge , new_counter, new_counter_vec,
2020 new_gauge, new_histogram_vec,
2121} ;
2222
@@ -30,19 +30,13 @@ pub struct StorageMetrics {
3030 pub searcher_split_cache : CacheMetrics ,
3131 pub get_slice_timeout_successes : [ IntCounter ; 3 ] ,
3232 pub get_slice_timeout_all_timeouts : IntCounter ,
33- pub object_storage_get_total : IntCounter ,
34- pub object_storage_get_errors_total : IntCounterVec < 1 > ,
33+ pub object_storage_requests_total : IntCounterVec < 2 > ,
34+ pub object_storage_request_duration : HistogramVec < 2 > ,
3535 pub object_storage_get_slice_in_flight_count : IntGauge ,
3636 pub object_storage_get_slice_in_flight_num_bytes : IntGauge ,
37- pub object_storage_put_total : IntCounter ,
38- pub object_storage_put_parts : IntCounter ,
3937 pub object_storage_download_num_bytes : IntCounter ,
38+ pub object_storage_download_errors : IntCounterVec < 1 > ,
4039 pub object_storage_upload_num_bytes : IntCounter ,
41-
42- pub object_storage_delete_requests_total : IntCounter ,
43- pub object_storage_bulk_delete_requests_total : IntCounter ,
44- pub object_storage_delete_request_duration : Histogram ,
45- pub object_storage_bulk_delete_request_duration : Histogram ,
4640}
4741
4842impl Default for StorageMetrics {
@@ -63,31 +57,6 @@ impl Default for StorageMetrics {
6357 let get_slice_timeout_all_timeouts =
6458 get_slice_timeout_outcome_total_vec. with_label_values ( [ "all_timeouts" ] ) ;
6559
66- let object_storage_requests_total = new_counter_vec (
67- "object_storage_requests_total" ,
68- "Total number of object storage requests performed." ,
69- "storage" ,
70- & [ ] ,
71- [ "action" ] ,
72- ) ;
73- let object_storage_delete_requests_total =
74- object_storage_requests_total. with_label_values ( [ "delete_object" ] ) ;
75- let object_storage_bulk_delete_requests_total =
76- object_storage_requests_total. with_label_values ( [ "delete_objects" ] ) ;
77-
78- let object_storage_request_duration = new_histogram_vec (
79- "object_storage_request_duration_seconds" ,
80- "Duration of object storage requests in seconds." ,
81- "storage" ,
82- & [ ] ,
83- [ "action" ] ,
84- vec ! [ 0.1 , 0.5 , 1.0 , 5.0 , 10.0 , 30.0 , 60.0 ] ,
85- ) ;
86- let object_storage_delete_request_duration =
87- object_storage_request_duration. with_label_values ( [ "delete_object" ] ) ;
88- let object_storage_bulk_delete_request_duration =
89- object_storage_request_duration. with_label_values ( [ "delete_objects" ] ) ;
90-
9160 StorageMetrics {
9261 fast_field_cache : CacheMetrics :: for_component ( "fastfields" ) ,
9362 fd_cache_metrics : CacheMetrics :: for_component ( "fd" ) ,
@@ -97,19 +66,23 @@ impl Default for StorageMetrics {
9766 split_footer_cache : CacheMetrics :: for_component ( "splitfooter" ) ,
9867 get_slice_timeout_successes,
9968 get_slice_timeout_all_timeouts,
100- object_storage_get_total : new_counter (
101- "object_storage_gets_total" ,
102- "Number of objects fetched. Might be lower than get_slice_timeout_outcome if \
103- queries are debounced.",
69+ object_storage_requests_total : new_counter_vec (
70+ "object_storage_requests_total" ,
71+ "Number of requests to the object store, by action and status. Requests are \
72+ recorded when the response headers are returned, download failures will not \
73+ appear as errors.",
10474 "storage" ,
10575 & [ ] ,
76+ [ "action" , "status" ] ,
10677 ) ,
107- object_storage_get_errors_total : new_counter_vec :: < 1 > (
108- "object_storage_get_errors_total" ,
109- "Number of GetObject errors." ,
78+ object_storage_request_duration : new_histogram_vec (
79+ "object_storage_request_duration" ,
80+ "Durations until the response headers are returned from the object store, by \
81+ action and status. This does not measure the download time.",
11082 "storage" ,
11183 & [ ] ,
112- [ "code" ] ,
84+ [ "action" , "status" ] ,
85+ vec ! [ 0.1 , 0.5 , 1.0 , 5.0 , 10.0 , 30.0 , 60.0 ] ,
11386 ) ,
11487 object_storage_get_slice_in_flight_count : new_gauge (
11588 "object_storage_get_slice_in_flight_count" ,
@@ -124,35 +97,26 @@ impl Default for StorageMetrics {
12497 "storage" ,
12598 & [ ] ,
12699 ) ,
127- object_storage_put_total : new_counter (
128- "object_storage_puts_total" ,
129- "Number of objects uploaded. May differ from object_storage_requests_parts due to \
130- multipart upload.",
131- "storage" ,
132- & [ ] ,
133- ) ,
134- object_storage_put_parts : new_counter (
135- "object_storage_puts_parts" ,
136- "Number of object parts uploaded." ,
137- "" ,
138- & [ ] ,
139- ) ,
140100 object_storage_download_num_bytes : new_counter (
141101 "object_storage_download_num_bytes" ,
142102 "Amount of data downloaded from an object storage." ,
143103 "storage" ,
144104 & [ ] ,
145105 ) ,
106+ object_storage_download_errors : new_counter_vec (
107+ "object_storage_download_errors" ,
108+ "Number of download requests that received successfull response headers but \
109+ failed during download.",
110+ "storage" ,
111+ & [ ] ,
112+ [ "status" ] ,
113+ ) ,
146114 object_storage_upload_num_bytes : new_counter (
147115 "object_storage_upload_num_bytes" ,
148116 "Amount of data uploaded to an object storage." ,
149117 "storage" ,
150118 & [ ] ,
151119 ) ,
152- object_storage_delete_requests_total,
153- object_storage_bulk_delete_requests_total,
154- object_storage_delete_request_duration,
155- object_storage_bulk_delete_request_duration,
156120 }
157121 }
158122}
0 commit comments