Skip to content

[9.3] (backport #11998) (bugfix) log level does not change when standalone agent is reloaded or when otel runtime is used#12127

Merged
pierrehilbert merged 1 commit into9.3from
mergify/bp/9.3/pr-11998
Jan 7, 2026
Merged

[9.3] (backport #11998) (bugfix) log level does not change when standalone agent is reloaded or when otel runtime is used#12127
pierrehilbert merged 1 commit into9.3from
mergify/bp/9.3/pr-11998

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Jan 7, 2026

What does this PR do?

When agent.logging.level config is changed during runtime in standalone elastic-agent, the new log level was not respected. (Note: This works in managed mode. This is the code path followed by managed mode for ref https://github.com/khushijain21/elastic-agent/blob/loglevel/internal/pkg/agent/application/actions/handlers/handler_action_settings.go#L54-L94 )

This PR fixes this bug and ensures this works both for process and OTel runtime.

Note: If both agent.logging.level and service::telemetry::logs::level are set - then the agent log level is applied to process runtime and telemetry::logs is applied to OTel runtime. If not, all components use agent.logging.level

Why is it important?

This is important so that we don't have to restart elastic-agent to update its logging level

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

Disruptive User Impact

None

How to test this PR locally

Start standalone elastic-agent with monitoring enabled and change the logging level without restarting. Observe the debug logs.

I tested this PR manually for both process and otel mode. And by switching from INFO-DEBUG-INFO.

Related issues


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

…or when otel runtime is used (#11998)

* Fix log level does not change when standalone agent is reloaded

(cherry picked from commit 85b7e99)
@mergify mergify Bot added the backport label Jan 7, 2026
@mergify mergify Bot requested a review from a team as a code owner January 7, 2026 05:06
@mergify mergify Bot requested review from blakerouse and ycombinator and removed request for a team January 7, 2026 05:06
@github-actions github-actions Bot added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Jan 7, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

cc @khushijain21

@pierrehilbert pierrehilbert merged commit ed48c48 into 9.3 Jan 7, 2026
24 checks passed
@pierrehilbert pierrehilbert deleted the mergify/bp/9.3/pr-11998 branch January 7, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 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.

3 participants