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

K8sattributes unable to enrich pod,node, namespace labels and annotations in logs #34601

Open Praveen2099 opened 3 months ago

Praveen2099 commented 3 months ago

Component(s)

receiver/filelog

What happened?

Description

I have gone through different regex and other documents to enrich labels and annotations in the logs.so i want otel collector configuration to get all labels and annotations of pods ,nodes and namespace.

Steps to Reproduce

Expected Result

Actual Result

Collector version

0.106.1

Environment information

Environment

OS: (e.g., "Ubuntu 20.04") Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

github-actions[bot] commented 3 months ago

Pinging code owners:

Praveen2099 commented 3 months ago

I have checked this doc but not working for me. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/k8sattributesprocessor/README.md

. So please give me the configurations how to do this

github-actions[bot] commented 3 months ago

Pinging code owners for processor/k8sattributes: @dmitryax @rmfitzpatrick @fatsheep9146 @TylerHelmuth. See Adding Labels via Comments if you do not have permissions to add labels yourself.

Praveen2099 commented 3 months ago

While deployed as Deployment it is working.

But while deployed as Daemon set it is not working k8s annotations labels not enriching

ChrsMark commented 3 months ago

Hey @Praveen2099. The component that adds the labels and annotations is the k8sattrbiutesprocessor, so I have marked this issue accordingly.

In addition, you will need to share the details about the issue you are facing.