4#include <unordered_set>
6#include <userver/tracing/span.hpp>
7#include <userver/tracing/tracer_fwd.hpp>
22 static void SetNoLogSpans(NoLogSpans&& spans);
23 static bool IsNoLogSpan(
const std::string& name);
25 static void SetTracer(TracerPtr tracer);
27 static TracerPtr GetTracer();
29 const std::string& GetServiceName()
const;
31 Span CreateSpanWithoutParent(std::string name);
33 Span CreateSpan(std::string name,
const Span& parent,
34 ReferenceType reference_type);
37 virtual void LogSpanContextTo(
const Span::Impl& span,
38 logging::impl::TagWriter writer)
const = 0;
40 logging::LoggerPtr GetOptionalLogger()
const {
return optional_logger_; }
43 explicit Tracer(std::string_view service_name,
44 logging::LoggerPtr optional_logger)
45 : service_name_(service_name),
46 optional_logger_(std::move(optional_logger)) {}
51 const std::string service_name_;
52 const logging::LoggerPtr optional_logger_;
57 std::string_view tracer_type =
"native");