Skip to content
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

[Fleet]: Agent logging level is not updated automatically for Upgraded agent from info to debug on making changes to Global agent logging level. #7053

Open
amolnater-qasource opened this issue Feb 20, 2025 · 5 comments
Labels
bug Something isn't working impact:medium Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@amolnater-qasource
Copy link

Kibana Build details:

VERSION: 9.0.0-SNAPSHOT
BUILD: 83694
COMMIT: 522b0d2de9bbcbcde9331799811760c80b8f54b8

Artifact Link: https://staging.elastic.co/8.18.0-01901d62/downloads/beats/elastic-agent/elastic-agent-8.18.0-linux-x86_64.tar.gz

Preconditions:

  1. 9.0.0-SNAPSHOT Kibana cloud environment should be available.

Steps to reproduce:

  1. Install 8.18.0 BC4 agent.
  2. Now install another 9.0.0 agent with the same policy.
  3. Trigger 8.18.0 agent upgrade to 9.0.0-beta1 and observe agent gets upgraded successfully.
  4. Now go the agent policy settings and change global agent logging level to debug.
  5. Observe logging level is not updated to debug for upgraded agent.

Expected Result:
Agent logging level should be updated automatically for Upgraded agent from info to debug on making changes to Global agent logging level.

Screen Recording:

Agents.-.Fleet.-.Elastic.-.Google.Chrome.2025-02-20.15-14-09.mp4

Logs:

elastic-agent-diagnostics-2025-02-20T09-45-01Z-00.zip

Agent policy:

elastic-agent (1).zip

@amolnater-qasource amolnater-qasource added bug Something isn't working impact:medium Team:Fleet Label for the Fleet team labels Feb 20, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@amolnater-qasource
Copy link
Author

@muskangulati-qasource Please review.

@muskangulati-qasource
Copy link

Secondary review is Done for this ticket!

@cmacknz
Copy link
Member

cmacknz commented Feb 26, 2025

Looking at the agent policy I see the log level is set to debug in pre-config.yaml:

agent:
    download:
        sourceURI: https://artifacts.elastic.co/downloads/
    features: null
    logging:
        level: debug

In the agent state, the log level is still info in state.yaml:

fleet_message: Connected
fleet_state: 2
log_level: info
message: Running
state: 2

The local agent-info.yaml still shows info:

agent_id: 61990689-398b-4073-a2ad-26fd50f00b8e
headers: {}
log_level: info
snapshot: false
unprivileged: false
version: 9.0.0-beta1

I see the following in the agent logs:

{"log.level":"info","@timestamp":"2025-02-20T09:17:43.184Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/application/actions/handlers.(*PolicyChangeHandler).applyLoggingConfig","file.name":"handlers/handler_action_policy_change.go","file.line":405},"message":"Setting fallback log level info from policy","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}

{"log.level":"info","@timestamp":"2025-02-20T09:33:26.474Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/application/actions/handlers.(*PolicyChangeHandler).applyLoggingConfig","file.name":"handlers/handler_action_policy_change.go","file.line":405},"message":"Setting fallback log level debug from policy","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}

I think the problem is on the agent side of this.

@cmacknz cmacknz transferred this issue from elastic/kibana Feb 26, 2025
@cmacknz cmacknz added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team and removed Team:Fleet Label for the Fleet team labels Feb 26, 2025
@elasticmachine
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working impact:medium Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

4 participants