userver
C++ Async Framework
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
Toggle main menu visibility
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
component.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/otlp/logs/component.hpp
4
/// @brief @copybrief otlp::LoggerComponent
5
6
#
include
<
memory
>
7
#
include
<
string
>
8
9
#
include
<
userver
/
components
/
component_fwd
.
hpp
>
10
#
include
<
userver
/
components
/
raw_component_base
.
hpp
>
11
#
include
<
userver
/
logging
/
fwd
.
hpp
>
12
#
include
<
userver
/
utils
/
statistics
/
entry
.
hpp
>
13
14
USERVER_NAMESPACE_BEGIN
15
16
namespace
otlp {
17
18
class
Logger;
19
20
// clang-format off
21
22
/// @ingroup userver_components
23
///
24
/// @brief Component to configure logging via OTLP collector.
25
///
26
/// ## Static options:
27
/// Name | Description | Default value
28
/// ---- | ----------- | -------------
29
/// endpoint | URI of otel collector (e.g. 127.0.0.1:4317) | -
30
/// max-queue-size | Maximum async queue size | 65535
31
/// max-batch-delay | Maximum batch delay | 100ms
32
/// service-name | Service name | unknown_service
33
/// attributes | Extra attributes for OTLP, object of key/value strings | -
34
/// sinks | List of sinks | -
35
/// sinks.logs | sink for logs (default|otlp|both) | otlp
36
/// sinks.tracing | sink for tracing (default|otlp|both) | otlp
37
///
38
/// Possible sink values:
39
/// * `otlp`: OTLP exporter
40
/// * `default`: _default_ logger from the `logging` component
41
/// * `both`: _default_ logger and OTLP exporter
42
43
// clang-format on
44
class
LoggerComponent
final
:
public
components
::
RawComponentBase
{
45
public
:
46
static
constexpr
std::string_view kName =
"otlp-logger"
;
47
48
LoggerComponent(
const
components
::ComponentConfig&,
const
components
::ComponentContext&);
49
50
~LoggerComponent();
51
52
static
yaml_config
::Schema GetStaticConfigSchema();
53
54
private
:
55
std::shared_ptr<Logger> logger_;
56
logging
::LoggerRef old_logger_;
57
utils
::statistics::Entry statistics_holder_;
58
};
44
class
LoggerComponent
final
:
public
components
::
RawComponentBase
{
…
};
59
60
}
// namespace otlp
61
62
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
otlp
logs
component.hpp
Generated on Wed Apr 30 2025 15:51:21 for userver by
Doxygen
1.13.2