Skip to content

[9.6](backport #53348) [beatreceiver] Fix manager.Enabled() usages in OTel mode - #54084

Merged
khushijain21 merged 3 commits into
9.6from
mergify/bp/9.6/pr-53348
Nov 16, 2026
Merged

khushijain21 merged 3 commits into
9.6from
mergify/bp/9.6/pr-53348

Conversation

@mergify

@mergify mergify Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

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 #53106

This PR removes the Enabled() method from the v2Manager interface and the beats repo will now rely on management.UnderAgent() method to evaluate conditionals.

This PR also introduces a new method called func ConfigFromControlProtocol() bool to 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

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • 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. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

FIxes any bug introduced by otel manager returning false for manager.Enabled() conditions

Related issues


This is an automatic backport of pull request #53348 done by [Mergify](https://mergify.com).

* 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
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix user-agent for hbreceiver

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 0d42775)
@mergify
mergify Bot requested review from a team as code owners October 26, 2026 18:33
@mergify
mergify Bot requested review from leehinman and removed request for a team October 26, 2026 18:33
@mergify mergify Bot added the backport label Oct 26, 2026
@mergify
mergify Bot requested review from ycombinator and removed request for a team October 26, 2026 18:33
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@github-actions github-actions Bot added Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Security-Service Integrations Security Service Integrations Team skip-changelog labels Oct 26, 2026
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Oct 26, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Dependency review finished without posting an analysis comment.

If you expected a review, push a new commit to this pull request (or close and reopen it) to try again.

Workflow run: https://github.com/elastic/beats/actions/runs/42043789993

@github-actions

This comment has been minimized.

@mergify

mergify Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

This pull request has not been merged yet. Could you please review and merge it @{{ assignee | join(', @') }}? 🙏

@khushijain21

Copy link
Copy Markdown
Contributor

This requires a 9.6 backport of this change #53654
Working on it

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

TL;DR

This Buildkite failure is infrastructure/tooling, not a test/code regression in this PR: the agent failed to download mage 1.15.0 (HTTP 504), so mage pythonIntegTest never started. Immediate action: retry the failed job/build.

Remediation

  • Re-run :ubuntu: Metricbeat: Python Integration Tests (Module) (or retry build 55770); this looks transient (curl: (22) ... 504).
  • If retries keep failing, harden bootstrap by pre-baking/caching mage 1.15.0 on the agent image or adding retry/fallback in the asdf mage install step.
Investigation details

Root Cause

Classification: Infrastructure.

The job fails before tests execute because mage is unavailable after a failed external download.

  • Pipeline expects ASDF_MAGE_VERSION: 1.15.0 at .buildkite/metricbeat/pipeline.yml:32.
  • Failed step runs mage pythonIntegTest at .buildkite/metricbeat/pipeline.yml:262-270.
  • Log shows install failure, then command-not-found behavior:
    • curl: (22) The requested URL returned error: 504
    • asdf-mage: Could not download .../mage_1.15.0_Linux-64bit.tar.gz
    • No preset version installed for command mage
    • exit status 126

Given this sequence, the failure is in environment bootstrap (tool fetch), not in PR logic/tests.

Evidence

  • Build: https://buildkite.com/elastic/beats/builds/55770
  • Job/step: :ubuntu: Metricbeat: Python Integration Tests (Module)
  • Key log excerpt (from /tmp/gh-aw/buildkite-logs/beats-metricbeat-ubuntu-metricbeat-python-integration-tests-module.txt):
    • lines 73-81: mage 1.15.0 install attempt + HTTP 504
    • lines 121-127: No preset version installed for command mage / asdf install mage 1.15.0
    • line 136: exited with status 126

Verification

  • Correlated failing command from pipeline config with Buildkite log evidence.
  • Local test execution: not run (failure occurs before test startup in CI bootstrap).

Follow-up

  • I attempted to check for an existing flaky-test issue reference, but issue-list reads were blocked by integrity policy in this run.

What is this? | From workflow: Observability Agentic Workflow — Status

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@mergify

mergify Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

This pull request has not been merged yet. Could you please review and merge it @{{ assignee | join(', @') }}? 🙏

@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is merged.

@mergify

mergify Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

This pull request has not been merged yet. Could you please review and merge it @{{ assignee | join(', @') }}? 🙏

@khushijain21
khushijain21 enabled auto-merge (squash) November 16, 2026 05:13
@khushijain21
khushijain21 merged commit 42fb74c into 9.6 Nov 16, 2026
236 of 239 checks passed
@khushijain21
khushijain21 deleted the mergify/bp/9.6/pr-53348 branch November 16, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Security-Service Integrations Security Service Integrations Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants