|
19 | 19 |
|
20 | 20 | #include <opentelemetry/proto/collector/logs/v1/logs_service_client.usrv.pb.hpp> |
21 | 21 |
|
| 22 | +#ifndef ARCADIA_ROOT |
| 23 | +#include "generated/src/otlp/logs/component.yaml.hpp" // Y_IGNORE |
| 24 | +#endif |
| 25 | + |
22 | 26 | USERVER_NAMESPACE_BEGIN |
23 | 27 |
|
24 | 28 | namespace otlp { |
@@ -126,89 +130,7 @@ LoggerComponent::~LoggerComponent() { |
126 | 130 | } |
127 | 131 |
|
128 | 132 | yaml_config::Schema LoggerComponent::GetStaticConfigSchema() { |
129 | | - return yaml_config::MergeSchemas<components::RawComponentBase>(R"( |
130 | | -type: object |
131 | | -description: > |
132 | | - OpenTelemetry logger component |
133 | | -additionalProperties: false |
134 | | -properties: |
135 | | - endpoint: |
136 | | - type: string |
137 | | - description: > |
138 | | - Hostname:port of otel collector (gRPC). This endpoint is used |
139 | | - both for logs and traces. If you want separate endpoints, then |
140 | | - use "logs-endpoint" and "tracing-endpoint" members. |
141 | | - Please note that "endpoint" is mutually exclusive with either |
142 | | - "logs-endpoint" or "tracing-endpoint". Basically, you either have |
143 | | - one endpoint for both, or you specify directly what goes where. |
144 | | - logs-endpoint: |
145 | | - type: string |
146 | | - description: > |
147 | | - Hostname:port of otel collector (gRPC). This endpoint is used |
148 | | - only for logs. |
149 | | - tracing-endpoint: |
150 | | - type: string |
151 | | - description: > |
152 | | - Hostname:port of otel collector (gRPC). This endpoint is used |
153 | | - only for traces. |
154 | | - client-factory-name: |
155 | | - type: string |
156 | | - description: > |
157 | | - This component needs ugrpc::client::ClientFactoryComponent to |
158 | | - work and we will look for it with name given in this |
159 | | - parameter. |
160 | | - You need to set that component propertly, e.g. disable |
161 | | - middlwares (otherwise it will be an infinite loop of client |
162 | | - producing logs that go into otlp logger and back to client |
163 | | - and that causes even more logs). |
164 | | -
|
165 | | - Although it is possible to omit this parameter and use |
166 | | - default ClientFactoryComponent instance, it is not recommended |
167 | | - and will cause severe problems in the long run. |
168 | | -
|
169 | | - log-level: |
170 | | - type: string |
171 | | - description: log level |
172 | | - max-queue-size: |
173 | | - type: integer |
174 | | - description: max async queue size |
175 | | - max-batch-delay: |
176 | | - type: string |
177 | | - description: max delay between send batches (e.g. 100ms or 1s) |
178 | | - service-name: |
179 | | - type: string |
180 | | - description: service name |
181 | | - sinks: |
182 | | - type: object |
183 | | - description: sinks to send logs/traces to |
184 | | - additionalProperties: false |
185 | | - properties: |
186 | | - logs: |
187 | | - type: string |
188 | | - enum: [otlp, default, both] |
189 | | - description: logs sink |
190 | | - defaultDescription: otlp |
191 | | - tracing: |
192 | | - type: string |
193 | | - enum: [otlp, default, both] |
194 | | - description: tracing sink |
195 | | - defaultDescription: otlp |
196 | | - attributes-mapping: |
197 | | - type: object |
198 | | - description: rename rules for OTLP attributes |
199 | | - properties: {} |
200 | | - additionalProperties: |
201 | | - type: string |
202 | | - description: new attribute name |
203 | | - extra-attributes: |
204 | | - type: object |
205 | | - description: extra OTLP attributes |
206 | | - properties: {} |
207 | | - additionalProperties: |
208 | | - type: string |
209 | | - description: attribute value |
210 | | -
|
211 | | -)"); |
| 133 | + return yaml_config::MergeSchemasFromResource<components::RawComponentBase>("src/otlp/logs/component.yaml"); |
212 | 134 | } |
213 | 135 |
|
214 | 136 | } // namespace otlp |
|
0 commit comments