open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.1k stars 2.39k forks source link

K8sObjectReciever logs processor #36167

Open fordneild opened 2 weeks ago

fordneild commented 2 weeks ago

Component(s)

receiver/k8sobjects

Is your feature request related to a problem? Please describe.

I need some mechanism to enrich the logs that are generated from the k8sobjectreciever, to add fields such as the host.

Describe the solution you'd like

The filelog reciever has a very flexible pipeline which allows me to enrich normal logs with information such as the host.

Describe alternatives you've considered

Ive considered adding random labels to all of my k8s objects, which specify the host, but imo that is a fairly gross solution with a lot of bloat. Also this isnt always possible for 3rd party resources.

Additional context

Even the ability to add a static map to the generated json logs would be very useful, it need not be as complex as the filelog reciever

github-actions[bot] commented 2 weeks ago

Pinging code owners:

ChrsMark commented 2 weeks ago

I need some mechanism to enrich the logs that are generated from the k8sobjectreciever, to add fields such as the host.

Could you elaborate more on what attributes you would like to add? From this description it's not clear to me.

atoulme commented 1 week ago

See k8sattributesprocessor to decorate signals from pods/nodes.