Expose HEAD Object operation metrics in the same format as existing RGW op metrics so operators can track HEAD request volume and latency at gateway, user, and bucket scope.
Previously, HEAD Object requests were silently counted under get_obj_ops because RGWGetObj handles both GET and HEAD. The HEAD-specific early-return path (get_data == false) had no counter instrumentation.
Fixes: ISCE-3042
Signed-off-by: Harsimran Singh <harsimransingh@ibm.com>
* - list_bucket_lat
- Gauge
- Total latency of list bucket operations
+ * - head_obj_ops
+ - Counter
+ - Number of successful HEAD Object operations
+ * - head_obj_lat
+ - Gauge
+ - Total latency of HEAD Object operations
There are three different sections in the output of the ``counter dump`` and ``counter schema`` commands that show the op metrics and their information.
The sections are ``rgw_op``, ``rgw_op_per_user``, and ``rgw_op_per_bucket``.
"avgcount": 1,
"sum": 0.002300000,
"avgtime": 0.002300000
+ },
+ "head_obj_ops": 3,
+ "head_obj_lat": {
+ "avgcount": 3,
+ "sum": 0.006123456,
+ "avgtime": 0.002041152
}
}
},
"avgcount": 1,
"sum": 0.002300000,
"avgtime": 0.002300000
+ },
+ "head_obj_ops": 3,
+ "head_obj_lat": {
+ "avgcount": 3,
+ "sum": 0.006123456,
+ "avgtime": 0.002041152
}
}
},
if (get_type() == RGW_OP_STAT_OBJ) {
return;
}
+
if (s->info.env->exists("HTTP_X_RGW_AUTH")) {
op_ret = 0;
goto done_err;
if (!get_data || ofs > end) {
send_response_data(bl, 0, 0);
+ if (!get_data) {
+ rgw::op_counters::inc(counters, l_rgw_op_head_obj, 1);
+ rgw::op_counters::tinc(counters, l_rgw_op_head_obj_lat, s->time_elapsed());
+ }
return;
}
lpcb->add_u64_counter(l_rgw_op_list_buckets, "list_buckets_ops", "List buckets");
lpcb->add_time_avg(l_rgw_op_list_buckets_lat, "list_buckets_lat", "List buckets latency");
+
+ lpcb->add_u64_counter(l_rgw_op_head_obj, "head_obj_ops","Head object operations");
+ lpcb->add_time_avg(l_rgw_op_head_obj_lat, "head_obj_lat","Head object latency");
}
void add_rgw_topic_counters(PerfCountersBuilder *lpcb) {
l_rgw_op_list_buckets,
l_rgw_op_list_buckets_lat,
-
+
+ l_rgw_op_head_obj,
+ l_rgw_op_head_obj_lat,
+
l_rgw_op_last
};