16
16
17
17
use once_cell:: sync:: Lazy ;
18
18
use 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,
20
20
new_gauge, new_histogram_vec,
21
21
} ;
22
22
@@ -30,19 +30,13 @@ pub struct StorageMetrics {
30
30
pub searcher_split_cache : CacheMetrics ,
31
31
pub get_slice_timeout_successes : [ IntCounter ; 3 ] ,
32
32
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 > ,
35
35
pub object_storage_get_slice_in_flight_count : IntGauge ,
36
36
pub object_storage_get_slice_in_flight_num_bytes : IntGauge ,
37
- pub object_storage_put_total : IntCounter ,
38
- pub object_storage_put_parts : IntCounter ,
39
37
pub object_storage_download_num_bytes : IntCounter ,
38
+ pub object_storage_download_errors : IntCounterVec < 1 > ,
40
39
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 ,
46
40
}
47
41
48
42
impl Default for StorageMetrics {
@@ -63,31 +57,6 @@ impl Default for StorageMetrics {
63
57
let get_slice_timeout_all_timeouts =
64
58
get_slice_timeout_outcome_total_vec. with_label_values ( [ "all_timeouts" ] ) ;
65
59
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
-
91
60
StorageMetrics {
92
61
fast_field_cache : CacheMetrics :: for_component ( "fastfields" ) ,
93
62
fd_cache_metrics : CacheMetrics :: for_component ( "fd" ) ,
@@ -97,19 +66,23 @@ impl Default for StorageMetrics {
97
66
split_footer_cache : CacheMetrics :: for_component ( "splitfooter" ) ,
98
67
get_slice_timeout_successes,
99
68
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.",
104
74
"storage" ,
105
75
& [ ] ,
76
+ [ "action" , "status" ] ,
106
77
) ,
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.",
110
82
"storage" ,
111
83
& [ ] ,
112
- [ "code" ] ,
84
+ [ "action" , "status" ] ,
85
+ vec ! [ 0.1 , 0.5 , 1.0 , 5.0 , 10.0 , 30.0 , 60.0 ] ,
113
86
) ,
114
87
object_storage_get_slice_in_flight_count : new_gauge (
115
88
"object_storage_get_slice_in_flight_count" ,
@@ -124,35 +97,26 @@ impl Default for StorageMetrics {
124
97
"storage" ,
125
98
& [ ] ,
126
99
) ,
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
- ) ,
140
100
object_storage_download_num_bytes : new_counter (
141
101
"object_storage_download_num_bytes" ,
142
102
"Amount of data downloaded from an object storage." ,
143
103
"storage" ,
144
104
& [ ] ,
145
105
) ,
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
+ ) ,
146
114
object_storage_upload_num_bytes : new_counter (
147
115
"object_storage_upload_num_bytes" ,
148
116
"Amount of data uploaded to an object storage." ,
149
117
"storage" ,
150
118
& [ ] ,
151
119
) ,
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,
156
120
}
157
121
}
158
122
}
0 commit comments