12#include <userver/tracing/tracer_fwd.hpp>
13#include <userver/utils/impl/source_location.hpp>
16USERVER_NAMESPACE_BEGIN
31 explicit Span(TracerPtr tracer, std::string name,
const Span* parent,
32 ReferenceType reference_type,
34 utils::impl::SourceLocation source_location =
35 utils::impl::SourceLocation::Current());
39 explicit Span(std::string name,
40 ReferenceType reference_type = ReferenceType::kChild,
42 utils::impl::SourceLocation source_location =
43 utils::impl::SourceLocation::Current());
47 explicit Span(Span::Impl& impl);
54 Span& operator=(
const Span&) =
delete;
75 std::string_view parent_span_id);
79 std::string_view parent_span_id, std::string link);
87 Span CreateFollower(std::string name)
const;
129 const std::string& scope_name)
const;
133 void AddTag(std::string key, logging::LogExtra::Value value);
163 std::string GetLink()
const;
165 std::string GetParentLink()
const;
167 const std::string& GetTraceId()
const;
168 const std::string& GetSpanId()
const;
169 const std::string& GetParentId()
const;
186 void AddTags(const
logging::LogExtra&,
utils::InternalTag);
188 impl::TimeStorage& GetTimeStorage();
192 std::
string GetTag(
std::string_view tag) const;
194 struct OptionalDeleter {
195 void operator()(Impl*)
const noexcept;
197 static OptionalDeleter ShouldDelete()
noexcept;
199 static OptionalDeleter DoNotDelete()
noexcept;
202 explicit OptionalDeleter(
bool do_delete) : do_delete(do_delete) {}
204 const bool do_delete;
207 std::unique_ptr<Impl, OptionalDeleter> pimpl_;