Skip to content

Conversation

@mauri870
Copy link
Member

@mauri870 mauri870 commented Nov 4, 2025

What does this PR do?

This PR adds a new experimental environment variable, AGENT_MONITORING_RUNTIME_EXPERIMENTAL, which overrides the runtime used by agent.monitoring components. This env takes precedence over the value set in configuration files, but has lower precedence than the policy when the agent is enrolled in Fleet.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • 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
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Related issues

@mauri870 mauri870 self-assigned this Nov 4, 2025
@mauri870 mauri870 added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-active-all Automated backport with mergify to all the active branches labels Nov 4, 2025
@mauri870 mauri870 force-pushed the container-envs-beats-receivers branch from 732f736 to 66827dd Compare November 5, 2025 13:22
@mauri870 mauri870 force-pushed the container-envs-beats-receivers branch from 58d05ca to 3e3e7ae Compare November 6, 2025 11:42
@mauri870 mauri870 force-pushed the container-envs-beats-receivers branch from 3e3e7ae to aad4f67 Compare November 6, 2025 11:46
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 6, 2025

⏳ Build in-progress, with failures

Failed CI Steps

History

cc @mauri870

@mauri870 mauri870 changed the title otel: add env variables to toggle beats receivers in elastic-agent container otel: add env variable to set agent.monitoring runtime Nov 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

🔍 Preview links for changed docs

@mauri870 mauri870 marked this pull request as ready for review November 6, 2025 14:52
@mauri870 mauri870 requested a review from a team as a code owner November 6, 2025 14:52
@elasticmachine
Copy link
Collaborator

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

Comment on lines +115 to +121
monRuntimeManager := DefaultRuntimeManager
monRuntimeEnv := os.Getenv("AGENT_MONITORING_RUNTIME_EXPERIMENTAL")
switch monRuntimeEnv {
case ProcessRuntimeManager, OtelRuntimeManager:
monRuntimeManager = monRuntimeEnv
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reviewers: The right place for this logic should be containerCfgOverrides, but unfortunately due to config reloading the value is discarded. This is an experimental environment variable that will eventually be removed, so hopefully it is fine to keep it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches enhancement New feature or request skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[beats receivers] Add environment variables to the elastic-agent container command to enable/disable beats receivers

2 participants