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

Filesystem refactor #31001

Merged
merged 38 commits into from
May 23, 2022
Merged

Conversation

fearful-symmetry
Copy link
Contributor

@fearful-symmetry fearful-symmetry commented Mar 24, 2022

What does this PR do?

This is a refactor of the system/filesystem and system/fsstat metricsets for the purpose of fixing #30590 Also also continuing to depricate the gosigar library.

I'm still in the process of testing this, but I'm currently juggling 3 other things so I at least need to get the PR in so I don't loose track of what I'm doing.

Why is it important?

This fixes a bug, removes code from metricbeat, and removes deprecated gosigar code.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • 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.

Fixes #30590

@fearful-symmetry fearful-symmetry self-assigned this Mar 24, 2022
@fearful-symmetry fearful-symmetry requested a review from a team as a code owner March 24, 2022 21:15
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Mar 24, 2022
@mergify
Copy link
Contributor

mergify bot commented Mar 24, 2022

This pull request does not have a backport label. Could you fix it @fearful-symmetry? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Mar 24, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 24, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-05-23T19:08:12.996+0000

  • Duration: 54 min 4 sec

Test stats 🧪

Test Results
Failed 0
Passed 3581
Skipped 885
Total 4466

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Apr 27, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b filesystem-refactor upstream/filesystem-refactor
git merge upstream/main
git push upstream filesystem-refactor

@mergify
Copy link
Contributor

mergify bot commented Apr 28, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b filesystem-refactor upstream/filesystem-refactor
git merge upstream/main
git push upstream filesystem-refactor

@jlind23
Copy link
Collaborator

jlind23 commented May 2, 2022

/test

@mergify
Copy link
Contributor

mergify bot commented May 2, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b filesystem-refactor upstream/filesystem-refactor
git merge upstream/main
git push upstream filesystem-refactor

@@ -33,15 +33,15 @@ type Int struct {
value int
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind opening a PR to elastic-agent-libs to update the opt package there as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, it's already in there. Huh.

@cmacknz cmacknz self-requested a review May 20, 2022 15:11
@cmacknz
Copy link
Member

cmacknz commented May 20, 2022

Looking at this again it's looked like it has changed a fair bit.

This fixes a bug, removes code from metricbeat, and removes deprecated gosigar code.

What is the bug that was fixed here? It's hard to spot in all the code? Also you need a CHANGELOG entry for it.

@fearful-symmetry
Copy link
Contributor Author

@cmacknz yup, hence why I asked for another review in slack. The original code wasn't respecting hostfs, which was the bug. Changelog incoming...

@fearful-symmetry
Copy link
Contributor Author

Alright, changlog added, reverted some of the opt changes.

@mergify
Copy link
Contributor

mergify bot commented May 20, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b filesystem-refactor upstream/filesystem-refactor
git merge upstream/main
git push upstream filesystem-refactor

- name: options
type: keyword
description: >
The options present on the filesystem mount.
Copy link
Member

Choose a reason for hiding this comment

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

Should this option be mentioned in the CHANGELOG?

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

LGTM again, I can't spot anything problematic.

@mergify
Copy link
Contributor

mergify bot commented May 23, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b filesystem-refactor upstream/filesystem-refactor
git merge upstream/main
git push upstream filesystem-refactor

@fearful-symmetry fearful-symmetry merged commit 1d4a7ca into elastic:main May 23, 2022
@toby-sutor
Copy link

It seems like this made it into version 8.3.1 as per https://github.com/elastic/beats/blob/v8.3.1/CHANGELOG.asciidoc#L34.

@cmacknz cmacknz added the backport-7.17 Automated backport to the 7.17 branch with mergify label Sep 8, 2022
mergify bot pushed a commit that referenced this pull request Sep 8, 2022
* first pass at filesystem refactoring

* cleanup code

* final cleanup

* cleanup, docs

* license headers

* make linter happy

* try to hack around linter platform issues

* fix function sig

* minor fixes, formatting

* try to make linter happy

* more linter fixes

* hopefully the last linter cleanup

* try to fix unit tests

* fix tests

* refactor after merges from elastic-agent libs

* make linter happy

* try to update deps

* okay, try that

* fix merge

* add changelog, revert opt changes

* fix broken merge

* mage update

(cherry picked from commit 1d4a7ca)

# Conflicts:
#	go.sum
#	metricbeat/module/system/fields.go
#	metricbeat/module/system/filesystem/_meta/fields.yml
#	metricbeat/module/system/filesystem/filesystem.go
#	metricbeat/module/system/filesystem/filesystem_test.go
#	metricbeat/module/system/filesystem/helper.go
#	metricbeat/module/system/fsstat/fsstat.go
#	metricbeat/module/system/test_system.py
cmacknz pushed a commit that referenced this pull request Sep 19, 2022
* Filesystem refactor (#31001)

* first pass at filesystem refactoring

* cleanup code

* final cleanup

* cleanup, docs

* license headers

* make linter happy

* try to hack around linter platform issues

* fix function sig

* minor fixes, formatting

* try to make linter happy

* more linter fixes

* hopefully the last linter cleanup

* try to fix unit tests

* fix tests

* refactor after merges from elastic-agent libs

* make linter happy

* try to update deps

* okay, try that

* fix merge

* add changelog, revert opt changes

* fix broken merge

* mage update

(cherry picked from commit 1d4a7ca)

# Conflicts:
#	go.sum
#	metricbeat/module/system/fields.go
#	metricbeat/module/system/filesystem/_meta/fields.yml
#	metricbeat/module/system/filesystem/filesystem.go
#	metricbeat/module/system/filesystem/filesystem_test.go
#	metricbeat/module/system/filesystem/helper.go
#	metricbeat/module/system/fsstat/fsstat.go
#	metricbeat/module/system/test_system.py

* attempt to clean up backport

* update notice

* try to make linter happy

* still fixing up backport

* still un-breaking merge

* fix changelog

Co-authored-by: Alex K <8418476+fearful-symmetry@users.noreply.github.com>
Co-authored-by: Alex Kristiansen <alex.kristiansen@elastic.co>
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
* first pass at filesystem refactoring

* cleanup code

* final cleanup

* cleanup, docs

* license headers

* make linter happy

* try to hack around linter platform issues

* fix function sig

* minor fixes, formatting

* try to make linter happy

* more linter fixes

* hopefully the last linter cleanup

* try to fix unit tests

* fix tests

* refactor after merges from elastic-agent libs

* make linter happy

* try to update deps

* okay, try that

* fix merge

* add changelog, revert opt changes

* fix broken merge

* mage update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-skip Skip notification from the automated backport with mergify bug enhancement Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metricbeat sytem module expects /etc/mtab which does not exist on all container runtimes
6 participants