Merge pull request #52392 from yuvalif/wip-yuval-trace-name

rgw: rename request traces and change for tags

reviewed-by: cbodley
This commit is contained in:
Yuval Lifshitz 2023-09-21 20:12:01 +03:00 committed by GitHub
commit 94ac81981f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 10 deletions

View 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);
}

View 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;