9#include <userver/logging/log.hpp>
10#include <userver/logging/log_extra.hpp>
11#include <userver/tracing/scope_time.hpp>
12#include <userver/tracing/tracer_fwd.hpp>
13#include <userver/utils/impl/internal_tag.hpp>
14#include <userver/utils/impl/source_location.hpp>
16USERVER_NAMESPACE_BEGIN
43 const utils::impl::SourceLocation& source_location =
utils::impl::SourceLocation::Current()
52 ReferenceType reference_type = ReferenceType::kChild,
53 const utils::impl::SourceLocation& source_location =
utils::impl::SourceLocation::Current()
56 Span(Span&& other)
noexcept;
57 Span(
const Span& other) =
delete;
58 Span& operator=(Span&&) =
delete;
59 Span& operator=(
const Span&) =
delete;
87 std::string_view trace_id,
88 std::string_view parent_span_id,
89 const utils::impl::SourceLocation& source_location =
utils::impl::SourceLocation::Current()
103 std::string_view trace_id,
104 std::string_view parent_span_id,
105 std::string_view link,
106 const utils::impl::SourceLocation& source_location =
utils::impl::SourceLocation::Current()
119 const utils::impl::SourceLocation& source_location =
utils::impl::SourceLocation::Current()
128 const utils::impl::SourceLocation& source_location =
utils::impl::SourceLocation::Current()
133 const utils::impl::SourceLocation& source_location =
utils::impl::SourceLocation::Current()
170 void AddNonInheritableTags(
const logging::LogExtra&);
177 void AddEvent(std::string_view event_name);
277 std::chrono::system_clock::time_point GetStartSystemTime()
const;
281 void AddTags(
const logging::LogExtra&,
utils::impl::InternalTag);
284 impl::TimeStorage& GetTimeStorage(
utils::impl::InternalTag);
287 void LogTo(
utils::impl::InternalTag,
logging::impl::TagWriter writer)
const;
291 struct OptionalDeleter {
292 void operator()(Impl*)
const noexcept;
294 static OptionalDeleter ShouldDelete()
noexcept;
296 static OptionalDeleter DoNotDelete()
noexcept;
299 explicit OptionalDeleter(
bool do_delete) : do_delete(do_delete) {}
301 const bool do_delete;
304 friend class SpanBuilder;
305 friend class TagScope;
306 friend class InPlaceSpan;
308 explicit Span(std::unique_ptr<Impl, OptionalDeleter>&& pimpl);
310 std::string_view GetTag(std::string_view tag)
const;
312 std::unique_ptr<Impl, OptionalDeleter> pimpl_;
317class DetachLocalSpansScope
final {
319 DetachLocalSpansScope()
noexcept;
320 ~DetachLocalSpansScope();
322 DetachLocalSpansScope(DetachLocalSpansScope&&) =
delete;
323 DetachLocalSpansScope& operator=(DetachLocalSpansScope&&) =
delete;
327 utils::FastPimpl<Impl, 16, 8> impl_;
330struct LogSpanAsLastNoCurrent
final {
334logging::LogHelper& operator<<(
logging::LogHelper& lh, LogSpanAsLastNoCurrent span);