open-telemetry / opentelemetry-collector-contrib

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

[cmd/opampsupervisor] Allow collector logs to passthrough to stdout #35473

Closed dpaasman00 closed 1 month ago

dpaasman00 commented 1 month ago

Component(s)

No response

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

When running the supervisor, collector logs are strictly directed to a file. This proves troublesome when running in a containerized environment. Collector logs can't be easily captured by the container platform's log management solution.

Describe the solution you'd like

An option to configure the supervisor to direct collector logs to passthrough to stdout would solve this problem.

Describe alternatives you've considered

Volume mounting the collector log file could be a valid workaround, but best practice for containers is to log to stdout by default. The user would need to worry about how to separate supervisor and collector logs, but at least this way they don't need to worry about configuring a volume mounted file.

Additional context

This issue is somewhat related to another issue I'm working on, #35466. The solution I have for this issue works by capturing collector output and using the supervisor's logging to send them to the same place as the supervisor's. The idea being that when running in a container the supervisor would be configured to log to stdout.

github-actions[bot] commented 1 month ago

Pinging code owners: