Skip to content

Commit eaa4ccd

Browse files
committed
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 <[email protected]>
1 parent 8e554bf commit eaa4ccd

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

doc/radosgw/metrics.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,15 @@ The following metrics related to S3 or Swift operations are tracked per Ceph Obj
7575
- Guage
7676
- Total latency of list bucket operations
7777

78-
More information about op metrics can be seen in the ``rgw_op`` section of the output of the ``counter schema`` command.
79-
To view op metrics in the Ceph Object Gateway go to the ``rgw_op`` section of the output of the ``counter dump`` command::
78+
There are three different sections in the output of the ``counter dump`` and ``counter schema`` commands that show the op metrics and their information.
79+
The sections are ``rgw_op``, ``rgw_op_per_user``, and ``rgw_op_per_bucket``.
80+
81+
The counters in the ``rgw_op`` section reflect the totals of each op metric for a given Ceph Object Gateway.
82+
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.
83+
84+
Information about op metrics can be seen in the ``rgw_op`` sections of the output of the ``counter schema`` command.
85+
86+
To view op metrics in the Ceph Object Gateway go to the ``rgw_op`` sections of the output of the ``counter dump`` command::
8087

8188
"rgw_op": [
8289
{
@@ -112,7 +119,7 @@ Op Metrics Labels
112119

113120
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}::
114121

115-
"rgw_op": [
122+
"rgw_op_per_bucket": [
116123
...
117124
{
118125
"labels": {

src/rgw/rgw_perf_counters.cc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,14 @@ namespace rgw::op_counters {
112112
ceph::perf_counters::PerfCountersCache *user_counters_cache = NULL;
113113
ceph::perf_counters::PerfCountersCache *bucket_counters_cache = NULL;
114114
PerfCounters *global_op_counters = NULL;
115-
const std::string rgw_op_counters_key = "rgw_op";
115+
const std::string rgw_global_op_counters_key = "rgw_op";
116+
const std::string rgw_user_op_counters_key = "rgw_op_per_user";
117+
const std::string rgw_bucket_op_counters_key = "rgw_op_per_bucket";
116118

117119
std::shared_ptr<PerfCounters> create_rgw_op_counters(const std::string& name, CephContext *cct) {
118120
std::string_view key = ceph::perf_counters::key_name(name);
119-
ceph_assert(rgw_op_counters_key == key);
121+
ceph_assert(rgw_global_op_counters_key == key ||
122+
rgw_user_op_counters_key == key || rgw_bucket_op_counters_key == key);
120123
PerfCountersBuilder pcb(cct, name, l_rgw_op_first, l_rgw_op_last);
121124
add_rgw_op_counters(&pcb);
122125
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
125128
}
126129

127130
void global_op_counters_init(CephContext *cct) {
128-
PerfCountersBuilder pcb(cct, rgw_op_counters_key, l_rgw_op_first, l_rgw_op_last);
131+
PerfCountersBuilder pcb(cct, rgw_global_op_counters_key, l_rgw_op_first, l_rgw_op_last);
129132
add_rgw_op_counters(&pcb);
130133
PerfCounters *new_counters = pcb.create_perf_counters();
131134
cct->get_perfcounters_collection()->add(new_counters);
@@ -138,18 +141,18 @@ CountersContainer get(req_state *s) {
138141

139142
if (user_counters_cache && !s->user->get_id().id.empty()) {
140143
if (s->user->get_tenant().empty()) {
141-
key = ceph::perf_counters::key_create(rgw_op_counters_key, {{"User", s->user->get_id().id}});
144+
key = ceph::perf_counters::key_create(rgw_user_op_counters_key, {{"user", s->user->get_id().id}});
142145
} else {
143-
key = ceph::perf_counters::key_create(rgw_op_counters_key, {{"User", s->user->get_id().id}, {"Tenant", s->user->get_tenant()}});
146+
key = ceph::perf_counters::key_create(rgw_user_op_counters_key, {{"user", s->user->get_id().id}, {"tenant", s->user->get_tenant()}});
144147
}
145148
counters.user_counters = user_counters_cache->get(key);
146149
}
147150

148151
if (bucket_counters_cache && !s->bucket_name.empty()) {
149152
if (s->bucket_tenant.empty()) {
150-
key = ceph::perf_counters::key_create(rgw_op_counters_key, {{"Bucket", s->bucket_name}});
153+
key = ceph::perf_counters::key_create(rgw_bucket_op_counters_key, {{"bucket", s->bucket_name}});
151154
} else {
152-
key = ceph::perf_counters::key_create(rgw_op_counters_key, {{"Bucket", s->bucket_name}, {"Tenant", s->bucket_tenant}});
155+
key = ceph::perf_counters::key_create(rgw_bucket_op_counters_key, {{"bucket", s->bucket_name}, {"tenant", s->bucket_tenant}});
153156
}
154157
counters.bucket_counters = bucket_counters_cache->get(key);
155158
}

0 commit comments

Comments
 (0)