From: Ali Maredia Date: Thu, 23 Nov 2023 00:31:39 +0000 (-0500) Subject: rgw: change section name of rgw_op counters X-Git-Tag: v19.1.0~349^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=eaa4ccd729c9937b998924b75f0e1a1d39b4af36;p=ceph.git rgw: change section name of rgw_op counters The rgw_op section of `counter dump/schema` becomes: - rgw_op_global for the global op counters - rgw_op_per_user for the user labeled counters - rgw_op_per_bucket for the bucket labeled counters Signed-off-by: Ali Maredia --- diff --git a/doc/radosgw/metrics.rst b/doc/radosgw/metrics.rst index dd5c56c1752ab..ee9e7225bc2bb 100644 --- a/doc/radosgw/metrics.rst +++ b/doc/radosgw/metrics.rst @@ -75,8 +75,15 @@ The following metrics related to S3 or Swift operations are tracked per Ceph Obj - Guage - Total latency of list bucket operations -More information about op metrics can be seen in the ``rgw_op`` section of the output of the ``counter schema`` command. -To view op metrics in the Ceph Object Gateway go to the ``rgw_op`` section of the output of the ``counter dump`` command:: +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``. + +The counters in the ``rgw_op`` section reflect the totals of each op metric for a given Ceph Object Gateway. +The counters in the ``rgw_op_per_user`` and ``rgw_op_per_bucket`` sections are labeled counters of op metrics for a user or bucket respectively. + +Information about op metrics can be seen in the ``rgw_op`` sections of the output of the ``counter schema`` command. + +To view op metrics in the Ceph Object Gateway go to the ``rgw_op`` sections of the output of the ``counter dump`` command:: "rgw_op": [ { @@ -112,7 +119,7 @@ Op Metrics Labels Op metrics can also be tracked per-user or per-bucket. These metrics are exported to Prometheus with labels like Bucket = {name} or User = {userid}:: - "rgw_op": [ + "rgw_op_per_bucket": [ ... { "labels": { diff --git a/src/rgw/rgw_perf_counters.cc b/src/rgw/rgw_perf_counters.cc index 125bace144506..40668c3d82273 100644 --- a/src/rgw/rgw_perf_counters.cc +++ b/src/rgw/rgw_perf_counters.cc @@ -112,11 +112,14 @@ namespace rgw::op_counters { ceph::perf_counters::PerfCountersCache *user_counters_cache = NULL; ceph::perf_counters::PerfCountersCache *bucket_counters_cache = NULL; PerfCounters *global_op_counters = NULL; -const std::string rgw_op_counters_key = "rgw_op"; +const std::string rgw_global_op_counters_key = "rgw_op"; +const std::string rgw_user_op_counters_key = "rgw_op_per_user"; +const std::string rgw_bucket_op_counters_key = "rgw_op_per_bucket"; std::shared_ptr create_rgw_op_counters(const std::string& name, CephContext *cct) { std::string_view key = ceph::perf_counters::key_name(name); - ceph_assert(rgw_op_counters_key == key); + ceph_assert(rgw_global_op_counters_key == key || + rgw_user_op_counters_key == key || rgw_bucket_op_counters_key == key); PerfCountersBuilder pcb(cct, name, l_rgw_op_first, l_rgw_op_last); add_rgw_op_counters(&pcb); std::shared_ptr new_counters(pcb.create_perf_counters()); @@ -125,7 +128,7 @@ std::shared_ptr create_rgw_op_counters(const std::string& name, Ce } void global_op_counters_init(CephContext *cct) { - PerfCountersBuilder pcb(cct, rgw_op_counters_key, l_rgw_op_first, l_rgw_op_last); + PerfCountersBuilder pcb(cct, rgw_global_op_counters_key, l_rgw_op_first, l_rgw_op_last); add_rgw_op_counters(&pcb); PerfCounters *new_counters = pcb.create_perf_counters(); cct->get_perfcounters_collection()->add(new_counters); @@ -138,18 +141,18 @@ CountersContainer get(req_state *s) { if (user_counters_cache && !s->user->get_id().id.empty()) { if (s->user->get_tenant().empty()) { - key = ceph::perf_counters::key_create(rgw_op_counters_key, {{"User", s->user->get_id().id}}); + key = ceph::perf_counters::key_create(rgw_user_op_counters_key, {{"user", s->user->get_id().id}}); } else { - key = ceph::perf_counters::key_create(rgw_op_counters_key, {{"User", s->user->get_id().id}, {"Tenant", s->user->get_tenant()}}); + key = ceph::perf_counters::key_create(rgw_user_op_counters_key, {{"user", s->user->get_id().id}, {"tenant", s->user->get_tenant()}}); } counters.user_counters = user_counters_cache->get(key); } if (bucket_counters_cache && !s->bucket_name.empty()) { if (s->bucket_tenant.empty()) { - key = ceph::perf_counters::key_create(rgw_op_counters_key, {{"Bucket", s->bucket_name}}); + key = ceph::perf_counters::key_create(rgw_bucket_op_counters_key, {{"bucket", s->bucket_name}}); } else { - key = ceph::perf_counters::key_create(rgw_op_counters_key, {{"Bucket", s->bucket_name}, {"Tenant", s->bucket_tenant}}); + key = ceph::perf_counters::key_create(rgw_bucket_op_counters_key, {{"bucket", s->bucket_name}, {"tenant", s->bucket_tenant}}); } counters.bucket_counters = bucket_counters_cache->get(key); }