]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: change section name of rgw_op counters
authorAli Maredia <amaredia@redhat.com>
Thu, 23 Nov 2023 00:31:39 +0000 (19:31 -0500)
committerAli Maredia <amaredia@redhat.com>
Wed, 31 Jan 2024 22:18:03 +0000 (17:18 -0500)
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 <amaredia@redhat.com>
doc/radosgw/metrics.rst
src/rgw/rgw_perf_counters.cc

index dd5c56c1752aba5fc3783f4513d1266ba2083dcb..ee9e7225bc2bb3bde92c85ba353ade8f1595b5e1 100644 (file)
@@ -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": {
index 125bace14450632146823fc3aba8d66b4f4ee0e6..40668c3d822731c7a1f353ab952468ac7833f971 100644 (file)
@@ -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<PerfCounters> 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<PerfCounters> new_counters(pcb.create_perf_counters());
@@ -125,7 +128,7 @@ std::shared_ptr<PerfCounters> 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);
   }