Skip to content

[Fleet] Fix selected log level when there is a policy override#259425

Merged
jsoriano merged 2 commits intoelastic:mainfrom
jsoriano:fix-log-level-selection
Mar 26, 2026
Merged

[Fleet] Fix selected log level when there is a policy override#259425
jsoriano merged 2 commits intoelastic:mainfrom
jsoriano:fix-log-level-selection

Conversation

@jsoriano
Copy link
Copy Markdown
Member

@jsoriano jsoriano commented Mar 24, 2026

Summary

If agent configuration contains no log level, the one in the assigned policy should be used, instead of the default one (info).

Aims to help on some issues we are investigating related to agents going back to the info logging level when they have a different one configured per-policy or per-agent.

In real cases the log level should never be undefined at this point, but just in case, ensure that the expected one is used instead of info.

Issue found while investigating with AI assistant

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@jsoriano jsoriano self-assigned this Mar 24, 2026
@jsoriano jsoriano requested a review from a team as a code owner March 24, 2026 16:48
@jsoriano jsoriano added release_note:fix Team:Fleet Team label for Observability Data Collection Fleet team sdh-linked backport:all-open Backport to all branches that could still receive a release labels Mar 24, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@jsoriano jsoriano enabled auto-merge (squash) March 26, 2026 11:59
@jsoriano jsoriano merged commit 2be40e3 into elastic:main Mar 26, 2026
19 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/23596656664

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #9 / discover responsive sidebar should render buttons in data view picker correctly
  • [job] [logs] Jest Integration Tests #8 / scripts/generate_plugin builds a generated plugin into a viable archive

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 2.3MB 2.3MB -5.0B

History

cc @jsoriano

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 26, 2026
…ic#259425)

If agent configuration contains no log level, the one in the assigned
policy should be used, instead of the default one (`info`).

Aims to help on some issues we are investigating related to agents going
back to the `info` logging level when they have a different one
configured per-policy or per-agent.

In real cases the log level should never be undefined at this point, but
just in case, ensure that the expected one is used instead of `info`.

(cherry picked from commit 2be40e3)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 26, 2026
…ic#259425)

If agent configuration contains no log level, the one in the assigned
policy should be used, instead of the default one (`info`).

Aims to help on some issues we are investigating related to agents going
back to the `info` logging level when they have a different one
configured per-policy or per-agent.

In real cases the log level should never be undefined at this point, but
just in case, ensure that the expected one is used instead of `info`.

(cherry picked from commit 2be40e3)
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Observability] [Alerting] Fix alert tags when source tags is a string (#259729)
9.2
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 259425

Questions ?

Please refer to the Backport tool documentation

shahargl pushed a commit to shahargl/kibana that referenced this pull request Mar 26, 2026
…ic#259425)

If agent configuration contains no log level, the one in the assigned
policy should be used, instead of the default one (`info`).

Aims to help on some issues we are investigating related to agents going
back to the `info` logging level when they have a different one
configured per-policy or per-agent.

In real cases the log level should never be undefined at this point, but
just in case, ensure that the expected one is used instead of `info`.
kibanamachine added a commit that referenced this pull request Mar 26, 2026
…259425) (#259779)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[Fleet] Fix selected log level when there is a policy override
(#259425)](#259425)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Jaime Soriano
Pastor","email":"jaime.soriano@elastic.co"},"sourceCommit":{"committedDate":"2026-03-26T13:23:59Z","message":"[Fleet]
Fix selected log level when there is a policy override (#259425)\n\nIf
agent configuration contains no log level, the one in the
assigned\npolicy should be used, instead of the default one
(`info`).\n\nAims to help on some issues we are investigating related to
agents going\nback to the `info` logging level when they have a
different one\nconfigured per-policy or per-agent.\n\nIn real cases the
log level should never be undefined at this point, but\njust in case,
ensure that the expected one is used instead of
`info`.","sha":"2be40e3fb7782e93e058ba417eeeeba8aba1ed08","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","sdh-linked","backport:all-open","v9.4.0"],"title":"[Fleet]
Fix selected log level when there is a policy
override","number":259425,"url":"https://github.com/elastic/kibana/pull/259425","mergeCommit":{"message":"[Fleet]
Fix selected log level when there is a policy override (#259425)\n\nIf
agent configuration contains no log level, the one in the
assigned\npolicy should be used, instead of the default one
(`info`).\n\nAims to help on some issues we are investigating related to
agents going\nback to the `info` logging level when they have a
different one\nconfigured per-policy or per-agent.\n\nIn real cases the
log level should never be undefined at this point, but\njust in case,
ensure that the expected one is used instead of
`info`.","sha":"2be40e3fb7782e93e058ba417eeeeba8aba1ed08"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259425","number":259425,"mergeCommit":{"message":"[Fleet]
Fix selected log level when there is a policy override (#259425)\n\nIf
agent configuration contains no log level, the one in the
assigned\npolicy should be used, instead of the default one
(`info`).\n\nAims to help on some issues we are investigating related to
agents going\nback to the `info` logging level when they have a
different one\nconfigured per-policy or per-agent.\n\nIn real cases the
log level should never be undefined at this point, but\njust in case,
ensure that the expected one is used instead of
`info`.","sha":"2be40e3fb7782e93e058ba417eeeeba8aba1ed08"}}]}]
BACKPORT-->

Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 27, 2026
…259425) (#259778)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Fleet] Fix selected log level when there is a policy override
(#259425)](#259425)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Jaime Soriano
Pastor","email":"jaime.soriano@elastic.co"},"sourceCommit":{"committedDate":"2026-03-26T13:23:59Z","message":"[Fleet]
Fix selected log level when there is a policy override (#259425)\n\nIf
agent configuration contains no log level, the one in the
assigned\npolicy should be used, instead of the default one
(`info`).\n\nAims to help on some issues we are investigating related to
agents going\nback to the `info` logging level when they have a
different one\nconfigured per-policy or per-agent.\n\nIn real cases the
log level should never be undefined at this point, but\njust in case,
ensure that the expected one is used instead of
`info`.","sha":"2be40e3fb7782e93e058ba417eeeeba8aba1ed08","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","sdh-linked","backport:all-open","v9.4.0"],"title":"[Fleet]
Fix selected log level when there is a policy
override","number":259425,"url":"https://github.com/elastic/kibana/pull/259425","mergeCommit":{"message":"[Fleet]
Fix selected log level when there is a policy override (#259425)\n\nIf
agent configuration contains no log level, the one in the
assigned\npolicy should be used, instead of the default one
(`info`).\n\nAims to help on some issues we are investigating related to
agents going\nback to the `info` logging level when they have a
different one\nconfigured per-policy or per-agent.\n\nIn real cases the
log level should never be undefined at this point, but\njust in case,
ensure that the expected one is used instead of
`info`.","sha":"2be40e3fb7782e93e058ba417eeeeba8aba1ed08"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259425","number":259425,"mergeCommit":{"message":"[Fleet]
Fix selected log level when there is a policy override (#259425)\n\nIf
agent configuration contains no log level, the one in the
assigned\npolicy should be used, instead of the default one
(`info`).\n\nAims to help on some issues we are investigating related to
agents going\nback to the `info` logging level when they have a
different one\nconfigured per-policy or per-agent.\n\nIn real cases the
log level should never be undefined at this point, but\njust in case,
ensure that the expected one is used instead of
`info`.","sha":"2be40e3fb7782e93e058ba417eeeeba8aba1ed08"}}]}]
BACKPORT-->

Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
…ic#259425)

If agent configuration contains no log level, the one in the assigned
policy should be used, instead of the default one (`info`).

Aims to help on some issues we are investigating related to agents going
back to the `info` logging level when they have a different one
configured per-policy or per-agent.

In real cases the log level should never be undefined at this point, but
just in case, ensure that the expected one is used instead of `info`.
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
…ic#259425)

If agent configuration contains no log level, the one in the assigned
policy should be used, instead of the default one (`info`).

Aims to help on some issues we are investigating related to agents going
back to the `info` logging level when they have a different one
configured per-policy or per-agent.

In real cases the log level should never be undefined at this point, but
just in case, ensure that the expected one is used instead of `info`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release release_note:fix sdh-linked Team:Fleet Team label for Observability Data Collection Fleet team v9.2.8 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants