File tree Expand file tree Collapse file tree
modules/job-logs-collector Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,22 +113,18 @@ category = "{{ category }}"
113113
114114%{ if enable_otel_router_logs }
115115[sinks .otel_router_non_internal ]
116- type = " opentelemetry "
116+ type = " http "
117117inputs = [ " remove_internal" ]
118+ uri = " http://127.0.0.1:${otel_router_http_port}/logs"
119+ method = " post"
118120healthcheck.enabled = false
119121buffer.type = " memory"
120122buffer.max_events = 500
121123buffer.when_full = " drop_newest"
124+ encoding.codec = " json"
125+ framing.method = " newline_delimited"
122126
123- [sinks .otel_router_non_internal .protocol ]
124- type = " http"
125- uri = " http://otel-router.service.consul:4318/v1/logs"
126- method = " post"
127-
128- [sinks .otel_router_non_internal .protocol .encoding ]
129- codec = " otlp"
130-
131- [sinks .otel_router_non_internal .protocol .request ]
127+ [sinks .otel_router_non_internal .request ]
132128retry_attempts = 0
133129timeout_secs = 2
134130%{ endif }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ locals {
1111 grafana_api_key = var.grafana_api_key
1212
1313 enable_otel_router_logs = var.enable_otel_router_logs
14+ otel_router_http_port = var.otel_router_http_port
1415 },
1516 )
1617
Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ variable "enable_otel_router_logs" {
3333 description = " Enable teeing non-internal customer logs from Vector to otel-router."
3434}
3535
36+ variable "otel_router_http_port" {
37+ type = number
38+ default = 4321
39+ description = " Local otel-router Vector-compatible logs port used by Vector when otel-router log teeing is enabled."
40+ }
41+
3642variable "vector_config_override" {
3743 type = string
3844 default = " "
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ tf_vars := AWS_PROFILE=$(AWS_PROFILE) AWS_REGION=$(AWS_REGION) \
4343 $(call tfvar, BUILD_SERVER_NESTED_VIRTUALIZATION) \
4444 $(call tfvar, AWS_ACCOUNT_ID) \
4545 $(call tfvar, AWS_REGION) \
46+ $(call tfvar, ENABLE_OTEL_ROUTER_LOGS) \
47+ $(call tfvar, OTEL_ROUTER_HTTP_PORT) \
4648 $(call tfvar, DB_MAX_OPEN_CONNECTIONS) \
4749 $(call tfvar, DB_MIN_IDLE_CONNECTIONS) \
4850 $(call tfvar, AUTH_DB_MAX_OPEN_CONNECTIONS) \
Original file line number Diff line number Diff line change @@ -231,6 +231,7 @@ module "nomad" {
231231 launch_darkly_api_key = module. init . launch_darkly_api_key
232232
233233 enable_otel_router_logs = var. enable_otel_router_logs
234+ otel_router_http_port = var. otel_router_http_port
234235
235236 db_max_open_connections = var. db_max_open_connections
236237 db_min_idle_connections = var. db_min_idle_connections
Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ module "logs_collector" {
272272 loki_endpoint = " http://loki.service.consul:${ var . loki_port } "
273273
274274 enable_otel_router_logs = var. enable_otel_router_logs
275+ otel_router_http_port = var. otel_router_http_port
275276
276277 vector_health_port = var. logs_health_proxy_port
277278 vector_api_port = var. logs_proxy_port
Original file line number Diff line number Diff line change @@ -303,6 +303,12 @@ variable "enable_otel_router_logs" {
303303 description = " Enable teeing non-internal customer logs from Vector to otel-router."
304304}
305305
306+ variable "otel_router_http_port" {
307+ type = number
308+ default = 4321
309+ description = " Local otel-router Vector-compatible logs port used by Vector when otel-router log teeing is enabled."
310+ }
311+
306312# Feature flags
307313variable "launch_darkly_api_key" {
308314 type = string
Original file line number Diff line number Diff line change @@ -198,3 +198,9 @@ variable "enable_otel_router_logs" {
198198 default = false
199199 description = " Enable teeing non-internal customer logs from Vector to otel-router."
200200}
201+
202+ variable "otel_router_http_port" {
203+ type = number
204+ default = 4321
205+ description = " Local otel-router Vector-compatible logs port used by Vector when otel-router log teeing is enabled."
206+ }
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ tf_vars := \
5959 $(call tfvar, LOKI_RESOURCES_MEMORY_MB) \
6060 $(call tfvar, OTEL_COLLECTOR_RESOURCES_CPU_COUNT) \
6161 $(call tfvar, OTEL_COLLECTOR_RESOURCES_MEMORY_MB) \
62+ $(call tfvar, ENABLE_OTEL_ROUTER_LOGS) \
63+ $(call tfvar, OTEL_ROUTER_HTTP_PORT) \
6264 $(call tfvar, TEMPLATE_BUCKET_NAME) \
6365 $(call tfvar, TEMPLATE_BUCKET_LOCATION) \
6466 $(call tfvar, ENVD_TIMEOUT) \
Original file line number Diff line number Diff line change @@ -286,6 +286,7 @@ module "nomad" {
286286 otel_collector_resources_memory_mb = var. otel_collector_resources_memory_mb
287287 otel_collector_resources_cpu_count = var. otel_collector_resources_cpu_count
288288 enable_otel_router_logs = var. enable_otel_router_logs
289+ otel_router_http_port = var. otel_router_http_port
289290
290291 # Dashboard API
291292 dashboard_api_count = var. dashboard_api_count
You can’t perform that action at this time.
0 commit comments