userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
manager_component.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/tracing/manager_component.hpp
4
/// @brief TracingManager base and default components
5
6
#
include
<
string
>
7
8
#
include
<
userver
/
components
/
component_base
.
hpp
>
9
#
include
<
userver
/
tracing
/
manager
.
hpp
>
10
#
include
<
userver
/
tracing
/
span
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
tracing
{
15
16
/// @brief Base component for implementing TracingManager component
17
// NOLINTNEXTLINE(fuchsia-multiple-inheritance)
18
class
TracingManagerComponentBase
:
public
components
::
ComponentBase
,
public
TracingManagerBase
{
19
public
:
20
TracingManagerComponentBase(
const
components
::ComponentConfig&,
const
components
::ComponentContext&);
21
};
18
class
TracingManagerComponentBase
:
public
components
::
ComponentBase
,
public
TracingManagerBase
{
…
};
22
23
// clang-format off
24
25
/// @ingroup userver_components
26
///
27
/// @brief Component that provides access to the actual TracingManager
28
/// that is used in handlers and clients.
29
///
30
/// This component allows conversion of tracing formats and allows working with
31
/// multiple tracing formats. For example:
32
/// @code
33
/// # yaml
34
/// incoming-format: ['opentelemetry', 'taxi']
35
/// new-requests-format: ['b3-alternative', 'opentelemetry']
36
/// @endcode
37
/// means that tracing data is extracted from OpenTelemetry headers if they
38
/// were received or from Yandex-Taxi specific headers. The outgoing requests
39
/// will have the tracing::Format::kB3Alternative headers and OpenTelemetry
40
/// headers at the same time.
41
///
42
/// The component can be configured in service config.
43
///
44
/// ## Static options:
45
/// Name | Description | Default value
46
/// ---- | ----------- | -------------
47
/// component-name | name of the component, that implements TracingManagerComponentBase | uses tracing::GenericTracingManager with below settings
48
/// incoming-format | Array of incoming tracing formats supported by tracing::FormatFromString | ['opentelemetry', 'taxi']
49
/// new-requests-format | Send tracing data in those formats supported by tracing::FormatFromString | ['opentelemetry', 'taxi']
50
///
51
// clang-format on
52
class
DefaultTracingManagerLocator
final
:
public
components
::
ComponentBase
{
53
public
:
54
/// @ingroup userver_component_names
55
/// @brief The default name of tracing::DefaultTracingManagerLocator
56
static
constexpr
std::string_view
kName
=
"tracing-manager-locator"
;
57
58
DefaultTracingManagerLocator(
const
components
::ComponentConfig&,
const
components
::ComponentContext&);
59
60
const
TracingManagerBase
& GetTracingManager()
const
;
61
62
static
yaml_config
::Schema GetStaticConfigSchema();
63
64
private
:
65
GenericTracingManager default_manager_;
66
const
TracingManagerBase
& tracing_manager_;
67
};
52
class
DefaultTracingManagerLocator
final
:
public
components
::
ComponentBase
{
…
};
68
69
}
// namespace tracing
70
71
template
<>
72
inline
constexpr
bool
components
::kHasValidate<tracing::DefaultTracingManagerLocator> =
true
;
73
74
template
<>
75
inline
constexpr
auto
components
::kConfigFileMode<tracing::DefaultTracingManagerLocator> =
ConfigFileMode
::
kNotRequired
;
76
77
USERVER_NAMESPACE_END
userver
tracing
manager_component.hpp
Generated on Wed Apr 30 2025 15:54:58 for userver by
Doxygen
1.13.2