Pod logs to vector using Opentelemetry Source #22884
-
We are currently using the kubernetes_logs source in Vector to collect pod logs, as all logs are being written to the filesystem. This setup works fine because it aligns well with the kubernetes_logs source. However, due to certain requirements, we are planning to switch to using the opentelemetry source in Vector. We have configured our application to route logs to the OpenTelemetry gRPC endpoint as follows:
We updated the Vector configuration to use the opentelemetry source like this:
However, when we run vector validate test.toml, we get the following error:
The source ID (logs) matches the inputs field in the filter, so I’m not sure why this error is occurring. Is it possible to directly send pod logs to the OpenTelemetry gRPC endpoint and process them in Vector without using an OpenTelemetry Collector? If so, how can we configure Vector to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @Padmashankari, this is a common error when it comes to components with multiple ports. You will have to use |
Beta Was this translation helpful? Give feedback.
-
Fixed it. Thanks @pront |
Beta Was this translation helpful? Give feedback.
-
In vector, we have source 'opentelemetry' which supports otlp grpc and http.https://vector.dev/docs/reference/configuration/sources/opentelemetry/ send container logs to otlp port (grpc:4317 or http:4318) Current setup: From pod side:
this sending logs to 4318 port (shows logs as:
From vector side:
And the port 4318 is exposed as cluster-IP. Here vector pod is running without any errors Problem: But the source is empty while using vector top. logs are not being able to receive from vector side. Question: Is it possible to send logs to vector without otel-collector? |
Beta Was this translation helpful? Give feedback.
Hi @Padmashankari, this is a common error when it comes to components with multiple ports. You will have to use
logs.logs
. See https://vector.dev/docs/reference/configuration/sources/opentelemetry/#logs