]>
Commit | Line | Data |
---|---|---|
20effc67 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | #pragma once | |
4 | #include "common/tracer.h" | |
5 | ||
6 | #include "rgw_common.h" | |
7 | ||
8 | namespace tracing { | |
9 | namespace rgw { | |
10 | ||
11 | const auto OP = "op"; | |
12 | const auto BUCKET_NAME = "bucket_name"; | |
13 | const auto USER_ID = "user_id"; | |
14 | const auto OBJECT_NAME = "object_name"; | |
15 | const auto RETURN = "return"; | |
16 | const auto UPLOAD_ID = "upload_id"; | |
17 | const auto TYPE = "type"; | |
18 | const auto REQUEST = "request"; | |
19 | const auto MULTIPART = "multipart_upload "; | |
20 | ||
21 | #ifdef HAVE_JAEGER | |
22 | extern thread_local tracing::Tracer tracer; | |
23 | #else | |
24 | extern tracing::Tracer tracer; | |
25 | #endif | |
26 | ||
27 | } // namespace rgw | |
28 | } // namespace tracing | |
29 | ||
30 | static inline void extract_span_context(const rgw::sal::Attrs& attr, jspan_context& span_ctx) { | |
31 | auto trace_iter = attr.find(RGW_ATTR_TRACE); | |
32 | if (trace_iter != attr.end()) { | |
33 | try { | |
34 | auto trace_bl_iter = trace_iter->second.cbegin(); | |
35 | tracing::decode(span_ctx, trace_bl_iter); | |
36 | } catch (buffer::error& err) {} | |
37 | } | |
38 | } |