Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
trace.hpp File Reference
#include <fc/log/zipkin.hpp>
#include <optional>
Include dependency graph for trace.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define fc_create_trace(TRACE_STR)
 
#define fc_create_trace_with_id(TRACE_STR, TRACE_ID)
 
#define fc_create_span(TRACE_VARNAME, SPAN_STR)
 
#define fc_create_span_from_token(TRACE_TOKEN, SPAN_STR)
 
#define fc_add_tag(SPAN_VARNAME, TAG_KEY_STR, TAG_VALUE_STR)
 

Macro Definition Documentation

◆ fc_add_tag

#define fc_add_tag ( SPAN_VARNAME,
TAG_KEY_STR,
TAG_VALUE_STR )
Value:
FC_MULTILINE_MACRO_BEGIN \
if( (SPAN_VARNAME) && ::fc::zipkin_config::is_enabled() ) \
(SPAN_VARNAME)->add_tag( (TAG_KEY_STR), (TAG_VALUE_STR) ); \
static bool is_enabled()
Thread safe only if init() called from main thread before spawning of any threads.
Definition zipkin.hpp:29
#define FC_MULTILINE_MACRO_END
Definition logger.hpp:74
Parameters
SPAN_VARNAMEvariable returned from fc_create_span
TAG_KEY_STRstring key
TAG_VALUEstring value

Definition at line 40 of file trace.hpp.

40#define fc_add_tag( SPAN_VARNAME, TAG_KEY_STR, TAG_VALUE_STR) \
41 FC_MULTILINE_MACRO_BEGIN \
42 if( (SPAN_VARNAME) && ::fc::zipkin_config::is_enabled() ) \
43 (SPAN_VARNAME)->add_tag( (TAG_KEY_STR), (TAG_VALUE_STR) ); \
44 FC_MULTILINE_MACRO_END

◆ fc_create_span

#define fc_create_span ( TRACE_VARNAME,
SPAN_STR )
Value:
( (TRACE_VARNAME) && ::fc::zipkin_config::is_enabled() ) ? \
(TRACE_VARNAME).opt->create_span( (SPAN_STR) ) \
: ::std::optional<::fc::zipkin_span>{};
Parameters
TRACE_VARNAMEvariable returned from fc_create_trace
SPAN_STRconst char* indentifier
Returns
implementation defined type RAII object that submits span on exit of scope

Definition at line 24 of file trace.hpp.

24#define fc_create_span( TRACE_VARNAME, SPAN_STR ) \
25 ( (TRACE_VARNAME) && ::fc::zipkin_config::is_enabled() ) ? \
26 (TRACE_VARNAME).opt->create_span( (SPAN_STR) ) \
27 : ::std::optional<::fc::zipkin_span>{};

◆ fc_create_span_from_token

#define fc_create_span_from_token ( TRACE_TOKEN,
SPAN_STR )
Value:
( (TRACE_TOKEN) && ::fc::zipkin_config::is_enabled() ) ? \
::fc::zipkin_trace::create_span_from_token( (TRACE_TOKEN), (SPAN_STR) ) \
: ::std::optional<::fc::zipkin_span>{};
static std::optional< zipkin_span > create_span_from_token(zipkin_span::token token, std::string name)
Definition zipkin.hpp:160
Parameters
TRACE_TOKENvariable returned from trace.get_token()
SPAN_STRconst char* indentifier
Returns
implementation defined type RAII object that submits span on exit of scope

Definition at line 32 of file trace.hpp.

32#define fc_create_span_from_token( TRACE_TOKEN, SPAN_STR ) \
33 ( (TRACE_TOKEN) && ::fc::zipkin_config::is_enabled() ) ? \
34 ::fc::zipkin_trace::create_span_from_token( (TRACE_TOKEN), (SPAN_STR) ) \
35 : ::std::optional<::fc::zipkin_span>{};

◆ fc_create_trace

#define fc_create_trace ( TRACE_STR)
Value:
::fc::optional_trace{ ::std::optional<::fc::zipkin_trace>( ::std::in_place, (TRACE_STR) ) } \
Parameters
TRACE_STRconst char* identifier for trace
Returns
implementation defined type RAII object that submits trace on exit of scope

Definition at line 8 of file trace.hpp.

8#define fc_create_trace( TRACE_STR ) \
9 ::fc::zipkin_config::is_enabled() ? \
10 ::fc::optional_trace{ ::std::optional<::fc::zipkin_trace>( ::std::in_place, (TRACE_STR) ) } \
11 : ::fc::optional_trace{};

◆ fc_create_trace_with_id

#define fc_create_trace_with_id ( TRACE_STR,
TRACE_ID )
Value:
::fc::optional_trace{ ::std::optional<::fc::zipkin_trace>( ::std::in_place, ::fc::zipkin_span::to_id(TRACE_ID), (TRACE_STR) ) } \
static uint64_t to_id(const fc::sha256 &id)
Definition zipkin.cpp:192
Parameters
TRACE_STRconst char* identifier for trace
TRACE_IDfc::sha256 id to use
Returns
implementation defined type RAII object that submits trace on exit of scope

Definition at line 16 of file trace.hpp.

16#define fc_create_trace_with_id( TRACE_STR, TRACE_ID ) \
17 ::fc::zipkin_config::is_enabled() ? \
18 ::fc::optional_trace{ ::std::optional<::fc::zipkin_trace>( ::std::in_place, ::fc::zipkin_span::to_id(TRACE_ID), (TRACE_STR) ) } \
19 : ::fc::optional_trace{};