open-telemetry / opentelemetry-collector-contrib

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

Make it possible for Windowseventlogreceiver to deal with a missing channel #36237

Open stampflit opened 2 hours ago

stampflit commented 2 hours ago

Component(s)

receiver/windowseventlog

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

When using the Windowseventlogreceiver with a channel that doesn't exist, it forces the entire collector to shutdown. This is fine for the expected default behavior. However, I'm using the otlp collector on multiple machines and windows being windows, on some them, some of the channels I want to receive are missing. I still want my collector to run, possibly to write some log message but definitely not to shutdown.

Describe the solution you'd like

I have a simple workaround fix that I'm using for now: https://github.com/stampflit/opentelemetry-collector-contrib/commit/b646550890873d6d015690269dd15afdd339153a This is by far not in a shape to be upstreamed. But it kinda gets the point across of what my problem is and it presents a direction for how it could be solved.

Describe alternatives you've considered

Either I manually gather the channel availability of all machines and generate specific configurations for each one. I don't want to do that. Instead we should make it possible to make it configurable for the Collector to deal with a missing channel.

There are two approaches to solving it by it configurable:

Additional context

If there is a decision to solve this problem and to go with the second approach, I can gladly provide a proper implementation of a fix / help with testing. If we solve it on Stanza level, I think this will be a more longterm endeavor. I can help with the Windowseventlogreceiver related parts or again with testing, but I don't think I'm familiar enough with Stanza and it's design considerations and inner workings to help with coming up and implementing a solution with the first approach.

What are your thoughts?

github-actions[bot] commented 2 hours ago

Pinging code owners:

stampflit commented 2 hours ago

/label os:windows