userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
span_builder.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/tracing/span_builder.hpp
4
/// @brief @copybrief tracing::SpanBuilder
5
6
#
include
<
string
>
7
#
include
<
string_view
>
8
9
#
include
<
userver
/
tracing
/
span
.
hpp
>
10
#
include
<
userver
/
utils
/
impl
/
source_location
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
tracing
{
15
16
/// @brief Provides interface for editing Span, before final building.
17
class
SpanBuilder
final
{
18
public
:
19
explicit
SpanBuilder(
20
std::string name,
21
const
utils
::impl::SourceLocation& location =
utils
::impl::SourceLocation::Current()
22
);
23
24
void
SetTraceId(std::string_view trace_id);
25
std::string_view GetTraceId()
const
noexcept
;
26
void
SetSpanId(std::string_view span_id);
27
void
SetLink(std::string_view link);
28
void
SetParentSpanId(std::string_view parent_span_id);
29
void
SetParentLink(std::string_view parent_link);
30
31
void
AddTagFrozen(std::string key, logging::LogExtra::Value value);
32
void
AddNonInheritableTag(std::string key, logging::LogExtra::Value value);
33
34
void
SetLocalLogLevel(logging::
Level
log_level)
noexcept
;
35
36
void
SetSampled(
bool
sampled)
noexcept
;
37
38
Span Build() &&;
39
Span BuildDetachedFromCoroStack() &&;
40
41
private
:
42
std::unique_ptr<Span::Impl, Span::OptionalDeleter> pimpl_;
43
};
44
45
}
// namespace tracing
46
47
USERVER_NAMESPACE_END
userver
tracing
span_builder.hpp
Generated on
for userver by
Doxygen
1.17.0