-
Notifications
You must be signed in to change notification settings - Fork 204
Avoid using setenv in the embedded collector execution #10711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This pull request does not have a backport label. Could you fix it @swiatekm? 🙏
|
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
cmacknz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM considering we will remove this (probably once we get beats receivers enabled by default).
(cherry picked from commit 5546bd7) # Conflicts: # internal/pkg/otel/manager/execution_embedded.go
(cherry picked from commit 5546bd7)
What does this PR do?
When running the otel collector in-process, it passes env variables via a config provider wrapper instead of using
setenv. The solution is a bit hacky, but this mode isn't the default and is likely to be removed shortly.Why is it important?
The latter is not thread-safe and leads to race conditions. In particular, we have some peculiar flaky test failures on MacOS in unit tests that do this.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature works[ ] I have added an entry in./changelog/fragmentsusing the changelog tool[ ] I have added an integration test or an E2E testHow to test this PR locally
Running existing unit tests is enough.
Related issues