]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: rename request traces and change for tags
authorOmri Zeneva <ozeneva@redhat.com>
Tue, 20 Sep 2022 12:13:57 +0000 (08:13 -0400)
committerYuval Lifshitz <ylifshit@ibm.com>
Tue, 11 Jul 2023 09:52:27 +0000 (09:52 +0000)
when we have a lot of traces, for example on multisite configuration
we have traces for list_meta_logs and list_data_changes and
it become too verbose to have trans id as the trace name,
the filtering in the jaeger gui becomes a mess,
so we will have the trans_id as tag, so ops of same
type will be named the op name only for cleaner usage.

the tag 'return' is ambigious. the actual name should be 'op_result'
so we can distinguish between http return code and op return value.

the tag 'type' doesn't add extra information, so it removed.

s well, add host_id as tag for the request trace.

Signed-off-by: Omri Zeneva <ozeneva@redhat.com>
src/rgw/rgw_process.cc
src/rgw/rgw_tracer.h

index 8d20251f8f7488abb95088d870f1b49395c54ce4..1765e83d62244de8e611a54ce395cb6d90fff750 100644 (file)
@@ -383,11 +383,8 @@ int process_request(const RGWProcessEnv& penv,
       goto done;
     }
 
-
-    const auto trace_name = std::string(op->name()) + " " + s->trans_id;
-    s->trace = tracing::rgw::tracer.start_trace(trace_name, s->trace_enabled);
-    s->trace->SetAttribute(tracing::rgw::OP, op->name());
-    s->trace->SetAttribute(tracing::rgw::TYPE, tracing::rgw::REQUEST);
+    s->trace = tracing::rgw::tracer.start_trace(op->name(), s->trace_enabled);
+    s->trace->SetAttribute(tracing::rgw::TRANS_ID, s->trans_id);
 
     ret = rgw_process_authenticated(handler, op, req, s, yield, driver);
     if (ret < 0) {
@@ -402,7 +399,9 @@ int process_request(const RGWProcessEnv& penv,
 done:
   if (op) {
     if (s->trace) {
-      s->trace->SetAttribute(tracing::rgw::RETURN, op->get_ret());
+      s->trace->SetAttribute(tracing::rgw::OP_RESULT, op->get_ret());
+      s->trace->SetAttribute(tracing::rgw::HOST_ID, driver->get_host_id());
+
       if (!rgw::sal::User::empty(s->user)) {
         s->trace->SetAttribute(tracing::rgw::USER_ID, s->user->get_id().id);
       }
index 9cbae8b9c6792760fd5022dd2d7f6e636d37c181..827854fa44c0598e5e3757e071446212454658c6 100644 (file)
@@ -8,15 +8,15 @@
 namespace tracing {
 namespace rgw {
 
-const auto OP = "op";
+
 const auto BUCKET_NAME = "bucket_name";
 const auto USER_ID = "user_id";
 const auto OBJECT_NAME = "object_name";
-const auto RETURN = "return";
+const auto OP_RESULT = "op_result";
 const auto UPLOAD_ID = "upload_id";
-const auto TYPE = "type";
-const auto REQUEST = "request";
 const auto MULTIPART = "multipart_upload ";
+const auto TRANS_ID = "trans_id";
+const auto HOST_ID = "host_id";
 
 extern tracing::Tracer tracer;