5#include <userver/tracing/span.hpp>
6#include <userver/tracing/tracer_fwd.hpp>
21 static void SetNoLogSpans(NoLogSpans&& spans);
22 static bool IsNoLogSpan(
const std::string& name);
24 static void SetTracer(TracerPtr tracer);
26 static TracerPtr GetTracer();
28 const std::string& GetServiceName()
const;
30 Span CreateSpanWithoutParent(std::string name);
32 Span CreateSpan(std::string name,
const Span& parent, ReferenceType reference_type);
35 virtual void LogSpanContextTo(
const Span::Impl& span,
logging::impl::TagWriter writer)
const = 0;
37 logging::LoggerPtr GetOptionalLogger()
const {
return optional_logger_; }
40 explicit Tracer(std::string_view service_name,
logging::LoggerPtr optional_logger)
41 : service_name_(service_name), optional_logger_(std::move(optional_logger)) {}
46 const std::string service_name_;
47 const logging::LoggerPtr optional_logger_;
51TracerPtr
MakeTracer(std::string_view service_name,
logging::LoggerPtr logger, std::string_view tracer_type =
"native");