Repository navigation
[beatreceiver] Fix manager.Enabled() usages in OTel mode - #53348
Conversation
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
manager.Enabled() usages in OTel mode
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
userAgentMode and userAgentUnprivilegedMode now read the process-wide management.UnderAgent() instead of Manager.Enabled(), so the test has to drive management mode through that flag rather than the fake manager. Assisted-By: Cursor Co-authored-by: Cursor <cursoragent@cursor.com>
belimawr
left a comment
There was a problem hiding this comment.
Just the question about the user agent.
belimawr
left a comment
There was a problem hiding this comment.
On a quick glance LGTM. The fact that we're just delaying when b.Info.UserAgent is ready still bugs me a bit, but it's not enough to block the PR.
|
Needs backport to 9.6 - label added |
…54084) * Fix manager.enabled usages * fix tests * fix tests * fix packetbeat * address review comments * Set UnderAgent in TestUserAgentString userAgentMode and userAgentUnprivilegedMode now read the process-wide management.UnderAgent() instead of Manager.Enabled(), so the test has to drive management mode through that flag rather than the fake manager. Assisted-By: Cursor * fix user-agent for hbreceiver --------- (cherry picked from commit 0d42775) Co-authored-by: Khushi Jain <khushi.jain@elastic.co> Co-authored-by: Cursor <cursoragent@cursor.com>
Proposed commit message
OTel manager returns false when
manager.Enabled()is referenced across the codebase whereas the elastic-agent manager returns true. This caused certain side effects. See issue #53106This PR removes the
Enabled()method from thev2Managerinterface and the beats repo will now rely onmanagement.UnderAgent()method to evaluate conditionals.This PR also introduces a new method called
func ConfigFromControlProtocol() boolto differentiate beats running under elastic-agent process mode vs in OTel mode. There are certain code paths that must not be invoked by the receivers but should be elastic-agent.Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
FIxes any bug introduced by otel manager returning false for
manager.Enabled()conditionsRelated issues