Skip to content

Refactor SlowLogFieldProvider#140397

Merged
smalyshev merged 5 commits intoelastic:mainfrom
smalyshev:slowlog-refactor
Jan 9, 2026
Merged

Refactor SlowLogFieldProvider#140397
smalyshev merged 5 commits intoelastic:mainfrom
smalyshev:slowlog-refactor

Conversation

@smalyshev
Copy link
Contributor

@smalyshev smalyshev commented Jan 8, 2026

Refactoring includes:

  • Make SecuritySlowLogFieldProvider not depend on any settings
  • Move settings handling entirely to logs
  • Consolidate fields methods to one logFields()
  • Make EsqlLogger consistent with slowlogs
  • Combine create() methods

@smalyshev smalyshev added :Core/Infra/Logging Log management and logging utilities >refactoring labels Jan 8, 2026
@smalyshev smalyshev marked this pull request as ready for review January 8, 2026 20:52
@smalyshev smalyshev requested a review from a team as a code owner January 8, 2026 20:52
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Jan 8, 2026
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

Some minor comments but otherwise LGTM.

/**
* Do we want any user authentication context?
*/
private volatile boolean includeUserInformation;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's really necessary to mark this volatile. Settings updates are by nature async, so this being somewhat eventually consistent is fine IMO and probably not worth the perf hit on reading this field on every log entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the cluster state changes would be updating this variable, I am concerned the checks may get an old value... probably not likely to matter that much in real scenario, but might make some tests flaky. I can drop it and see if anything breaks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I hadn't considered test stability. You might be right. In production it doesn't really matter, it just means there may be some insignificant delay until the setting change actually takes hold.

@smalyshev smalyshev enabled auto-merge (squash) January 9, 2026 20:27
@smalyshev smalyshev merged commit 3237562 into elastic:main Jan 9, 2026
35 checks passed
jimczi pushed a commit to jimczi/elasticsearch that referenced this pull request Jan 12, 2026
* Refactor SlowLogFieldProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Logging Log management and logging utilities >refactoring Team:Core/Infra Meta label for core/infra team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants