Skip to content

[9.1] [scout] support log level override (#228841)#229557

Merged
dmlemeshko merged 1 commit intoelastic:9.1from
dmlemeshko:backport/9.1/pr-228841
Jul 28, 2025
Merged

[9.1] [scout] support log level override (#228841)#229557
dmlemeshko merged 1 commit intoelastic:9.1from
dmlemeshko:backport/9.1/pr-228841

Conversation

@dmlemeshko
Copy link
Contributor

Backport

This will backport the following commits from main to 9.1:

Questions ?

Please refer to the Backport tool documentation

## Summary

- default log level for Playwright fixtures is `info` , afaik default
for FTR and other scripts (but for now to better understand performance
issues we pass `debug` through `node scripts/scout`, to be reverted for
GA)
- `node scripts/scout` will propagate log level from cli flag (e.g.
--debug) with `SCOUT_LOG_LEVEL` env variable to playwright exec command
- since some Team may not use `scripts/scout` command, they can set
`LOG_LEVEL` variable to override to whatever level is needed
if both `LOG_LEVEL` and `SCOUT_LOG_LEVEL` are set, the later has
priority (important for us, shouldn't block others)

### Playwright Integration:
* Replaced the use of `getLogger` with the updated `ScoutLogger` call in
Playwright worker fixtures, enabling log level configuration via
environment variables.
* Modified the Playwright test runner to propagate the log level to the
test environment using the `SCOUT_LOG_LEVEL` variable.

---------

Co-authored-by: David Olaru <dolaru@vaevixen.com>
(cherry picked from commit d76a5be)

# Conflicts:
#	src/platform/packages/shared/kbn-scout/src/playwright/global_hooks/synthtrace_ingestion.ts
@dmlemeshko dmlemeshko added the backport This PR is a backport of another PR label Jul 28, 2025
@dmlemeshko dmlemeshko enabled auto-merge (squash) July 28, 2025 07:30
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/scout 122 120 -2
@kbn/scout-oblt 70 68 -2
@kbn/scout-security 67 65 -2
total -6
Unknown metric groups

API count

id before after diff
@kbn/scout 447 448 +1
@kbn/scout-oblt 364 365 +1
@kbn/scout-security 360 361 +1
total +3

@dmlemeshko dmlemeshko requested a review from csr July 28, 2025 09:04
@dmlemeshko dmlemeshko merged commit 1de8c33 into elastic:9.1 Jul 28, 2025
16 checks passed
dmlemeshko added a commit that referenced this pull request Aug 4, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[scout] support log level override
(#228841)](#228841)

<!--- Backport version: 10.0.0 -->

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

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2025-07-22T20:25:49Z","message":"[scout]
support log level override (#228841)\n\n## Summary\n\n- default log
level for Playwright fixtures is `info` , afaik default\nfor FTR and
other scripts (but for now to better understand performance\nissues we
pass `debug` through `node scripts/scout`, to be reverted for\nGA)\n-
`node scripts/scout` will propagate log level from cli flag
(e.g.\n--debug) with `SCOUT_LOG_LEVEL` env variable to playwright exec
command\n- since some Team may not use `scripts/scout` command, they can
set\n`LOG_LEVEL` variable to override to whatever level is needed\nif
both `LOG_LEVEL` and `SCOUT_LOG_LEVEL` are set, the later has\npriority
(important for us, shouldn't block others)\n\n### Playwright
Integration:\n* Replaced the use of `getLogger` with the updated
`ScoutLogger` call in\nPlaywright worker fixtures, enabling log level
configuration via\nenvironment variables.\n* Modified the Playwright
test runner to propagate the log level to the\ntest environment using
the `SCOUT_LOG_LEVEL` variable.\n\n---------\n\nCo-authored-by: David
Olaru
<dolaru@vaevixen.com>","sha":"d76a5befa5ec73425b44c10b24f66a19556a7e83","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v8.19.0","ci:scout-ui-tests","v9.2.0","v9.1.1"],"title":"[scout]
support log level
override","number":228841,"url":"https://github.com/elastic/kibana/pull/228841","mergeCommit":{"message":"[scout]
support log level override (#228841)\n\n## Summary\n\n- default log
level for Playwright fixtures is `info` , afaik default\nfor FTR and
other scripts (but for now to better understand performance\nissues we
pass `debug` through `node scripts/scout`, to be reverted for\nGA)\n-
`node scripts/scout` will propagate log level from cli flag
(e.g.\n--debug) with `SCOUT_LOG_LEVEL` env variable to playwright exec
command\n- since some Team may not use `scripts/scout` command, they can
set\n`LOG_LEVEL` variable to override to whatever level is needed\nif
both `LOG_LEVEL` and `SCOUT_LOG_LEVEL` are set, the later has\npriority
(important for us, shouldn't block others)\n\n### Playwright
Integration:\n* Replaced the use of `getLogger` with the updated
`ScoutLogger` call in\nPlaywright worker fixtures, enabling log level
configuration via\nenvironment variables.\n* Modified the Playwright
test runner to propagate the log level to the\ntest environment using
the `SCOUT_LOG_LEVEL` variable.\n\n---------\n\nCo-authored-by: David
Olaru
<dolaru@vaevixen.com>","sha":"d76a5befa5ec73425b44c10b24f66a19556a7e83"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228841","number":228841,"mergeCommit":{"message":"[scout]
support log level override (#228841)\n\n## Summary\n\n- default log
level for Playwright fixtures is `info` , afaik default\nfor FTR and
other scripts (but for now to better understand performance\nissues we
pass `debug` through `node scripts/scout`, to be reverted for\nGA)\n-
`node scripts/scout` will propagate log level from cli flag
(e.g.\n--debug) with `SCOUT_LOG_LEVEL` env variable to playwright exec
command\n- since some Team may not use `scripts/scout` command, they can
set\n`LOG_LEVEL` variable to override to whatever level is needed\nif
both `LOG_LEVEL` and `SCOUT_LOG_LEVEL` are set, the later has\npriority
(important for us, shouldn't block others)\n\n### Playwright
Integration:\n* Replaced the use of `getLogger` with the updated
`ScoutLogger` call in\nPlaywright worker fixtures, enabling log level
configuration via\nenvironment variables.\n* Modified the Playwright
test runner to propagate the log level to the\ntest environment using
the `SCOUT_LOG_LEVEL` variable.\n\n---------\n\nCo-authored-by: David
Olaru
<dolaru@vaevixen.com>","sha":"d76a5befa5ec73425b44c10b24f66a19556a7e83"}},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/229557","number":229557,"state":"MERGED","mergeCommit":{"sha":"1de8c338657942a87ceaa249b3a220a2ec26af92","message":"[9.1]
[scout] support log level override (#228841) (#229557)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`9.1`:\n- [[scout] support log level
override\n(#228841)](https://github.com/elastic/kibana/pull/228841)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants