userver: otlp::LoggerComponent Class Reference
Loading...
Searching...
No Matches
otlp::LoggerComponent Class Referencefinal

#include <userver/otlp/logs/component.hpp>

Detailed Description

Component to configure logging via OTLP collector.

Static options of otlp::LoggerComponent :

Name Description Default value
endpoint Hostname:port of otel collector (gRPC). This endpoint is used both for logs and traces. If you want separate endpoints, then use "logs-endpoint" and "tracing-endpoint" members. Please note that "endpoint" is mutually exclusive with either "logs-endpoint" or "tracing-endpoint". Basically, you either have one endpoint for both, or you specify directly what goes where.
logs-endpoint Hostname:port of otel collector (gRPC). This endpoint is used only for logs.
tracing-endpoint Hostname:port of otel collector (gRPC). This endpoint is used only for traces.
client-factory-name This component needs ugrpc::client::ClientFactoryComponent to work and we will look for it with name given in this parameter. You need to set that component propertly, e.g. disable middlwares (otherwise it will be an infinite loop of client producing logs that go into otlp logger and back to client and that causes even more logs). Although it is possible to omit this parameter and use default ClientFactoryComponent instance, it is not recommended and will cause severe problems in the long run.
log-level Log level.
max-queue-size Max async queue size. 65535
max-batch-delay Max delay between send batches (e.g. 100ms or 1s). 100ms
service-name Service name. unknown_service
sinks Sinks to send logs/traces to.
sinks.logs Logs sink, one of [otlp, default, both]. Possible values: otlp, default, both. otlp
sinks.tracing Tracing sink, one of [otlp, default, both]. Possible values: otlp, default, both. otlp
attributes-mapping.* Rename rules for OTLP attributes. Each of the elements: new attribute name.
extra-attributes.* Extra OTLP attributes. Each of the elements: attribute value.

Options inherited from components::ComponentBase :

Name Description Default value
load-enabled Set to false to disable loading of the component. true

Possible sink values:

  • otlp: OTLP exporter
  • default: default logger from the logging component
  • both: default logger and OTLP exporter

Definition at line 34 of file component.hpp.

+ Inheritance diagram for otlp::LoggerComponent:

Public Member Functions

 LoggerComponent (const components::ComponentConfig &, const components::ComponentContext &)
 
virtual ComponentHealth GetComponentHealth () const
 
virtual void OnLoadingCancelled ()
 
virtual void OnAllComponentsLoaded ()
 
virtual void OnAllComponentsAreStopping ()
 

Static Public Member Functions

static yaml_config::Schema GetStaticConfigSchema ()
 

Static Public Attributes

static constexpr std::string_view kName = "otlp-logger"
 The default name of otlp::LoggerComponent.
 

Member Function Documentation

◆ GetComponentHealth()

virtual ComponentHealth components::RawComponentBase::GetComponentHealth ( ) const
inlinevirtualinherited

Reimplemented in components::ComponentBase, and server::handlers::Restart.

Definition at line 49 of file raw_component_base.hpp.

◆ OnAllComponentsAreStopping()

virtual void components::RawComponentBase::OnAllComponentsAreStopping ( )
inlinevirtualinherited

◆ OnAllComponentsLoaded()

virtual void components::RawComponentBase::OnAllComponentsLoaded ( )
inlinevirtualinherited

◆ OnLoadingCancelled()

virtual void components::RawComponentBase::OnLoadingCancelled ( )
inlinevirtualinherited

Reimplemented in components::ComponentBase.

Definition at line 51 of file raw_component_base.hpp.


The documentation for this class was generated from the following file: