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

[8.x](backport #41108) Fix cgroup helper init in add_processor_metadata and add_docker_metadata processors #41185

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 9, 2024

Proposed commit message

Closes #41065

This refactors add_processor_metadata and add_docker_metadata so we only call NewReader once when we create a new processor, and not every time the processor runs. This should considerably cut down on CPU cycles for certain workloads, since NewReader has gotten much more complex over the years.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

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

…tadata` processors (#41108)

* only initialize cgroup reader once

* docs

* remove old struct fields

---------

Co-authored-by: Pierre HILBERT <pierre.hilbert@elastic.co>
(cherry picked from commit 13d71a6)
@mergify mergify bot requested a review from a team as a code owner October 9, 2024 14:29
@mergify mergify bot added the backport label Oct 9, 2024
@mergify mergify bot requested review from faec and leehinman and removed request for a team October 9, 2024 14:29
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 9, 2024
@botelastic
Copy link

botelastic bot commented Oct 9, 2024

This pull request doesn't have a Team:<team> label.

@pierrehilbert pierrehilbert enabled auto-merge (squash) October 9, 2024 14:44
@cmacknz
Copy link
Member

cmacknz commented Oct 11, 2024

This requires #41196 at the same time or it will break non-Linux systems when it merges, perhaps best to combine the two backports.

@cmacknz
Copy link
Member

cmacknz commented Oct 11, 2024

Three backports if you also want to include #41198 when that merges.

@fearful-symmetry
Copy link
Contributor

Alright, lets see if I can merge these two PRs without blowing things up....

* add tests, fallback properly if we can't init the cgroups

* linter

* fix test
@pierrehilbert pierrehilbert merged commit e6e4f5f into 8.x Oct 11, 2024
141 checks passed
@pierrehilbert pierrehilbert deleted the mergify/bp/8.x/pr-41108 branch October 11, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants