]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/rgw_tracer.h
import ceph quincy 17.2.6
[ceph.git] / ceph / src / rgw / rgw_tracer.h
CommitLineData
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
8namespace tracing {
9namespace rgw {
10
11const auto OP = "op";
12const auto BUCKET_NAME = "bucket_name";
13const auto USER_ID = "user_id";
14const auto OBJECT_NAME = "object_name";
15const auto RETURN = "return";
16const auto UPLOAD_ID = "upload_id";
17const auto TYPE = "type";
18const auto REQUEST = "request";
19const auto MULTIPART = "multipart_upload ";
20
21#ifdef HAVE_JAEGER
22extern thread_local tracing::Tracer tracer;
23#else
24extern tracing::Tracer tracer;
25#endif
26
27} // namespace rgw
28} // namespace tracing
29
30static 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}