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

Remove libbeat/metric and use github.com/elastic/elastic-agent-system-metrics instead #31615

Merged
merged 9 commits into from
May 23, 2022

Conversation

kvch
Copy link
Contributor

@kvch kvch commented May 12, 2022

What does this PR do?

This PR removes the folder libbeat/metric and imports the same functionality from github.com/elastic/elastic-agent-system-metrics.

I am not fixing linter issues.

Why is it important?

Avoid maintaining the same code in different places.

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 made corresponding change to the default configuration files
    - [ ] 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.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 12, 2022
@mergify mergify bot assigned kvch May 12, 2022
@mergify
Copy link
Contributor

mergify bot commented May 12, 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 use-system-metrics-lib upstream/use-system-metrics-lib
git merge upstream/main
git push upstream use-system-metrics-lib

@elasticmachine
Copy link
Collaborator

elasticmachine commented May 12, 2022

💔 Tests Failed

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-20T15:45:47.213+0000

  • Duration: 107 min 42 sec

Test stats 🧪

Test Results
Failed 1
Passed 22190
Skipped 1933
Total 24124

Test errors 1

Expand to view the tests failures

Build&Test / metricbeat-goIntegTest / TestFetch – github.com/elastic/beats/v7/metricbeat/module/mongodb/replstatus
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestFetch
        replstatus_integration_test.go:53: Expected 0 error, had 1. [error getting replication status: error running command 'replSetGetStatus' on admin db: (InvalidReplicaSetConfig) Our replica set config is invalid or we are not a member of it]
    --- FAIL: TestFetch (9.83s)
     
    

Steps errors 4

Expand to view the steps failures

metricbeat-goIntegTest - mage goIntegTest
  • Took 30 min 41 sec . View more details here
  • Description: mage goIntegTest
metricbeat-goIntegTest - mage goIntegTest
  • Took 20 min 3 sec . View more details here
  • Description: mage goIntegTest
metricbeat-goIntegTest - mage goIntegTest
  • Took 20 min 21 sec . View more details here
  • Description: mage goIntegTest
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: Error 'hudson.AbortException: script returned exit code 1'

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Genuine test errors 1

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Build&Test / metricbeat-goIntegTest / TestFetch – github.com/elastic/beats/v7/metricbeat/module/mongodb/replstatus

🤖 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!)

@fearful-symmetry
Copy link
Contributor

quick thing: The stuff in metricbeat/internal also needs to be removed and migrated to elastic-agent-system-metrics as well. It's fundamentally the same as the metrics in libbeat/, the code just dates to a time when we weren't sure where system metrics were supposed to live.

@mergify
Copy link
Contributor

mergify bot commented May 17, 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 use-system-metrics-lib upstream/use-system-metrics-lib
git merge upstream/main
git push upstream use-system-metrics-lib

@kvch kvch changed the title Use system metrics lib Remove libbeat/metric and use github.com/elastic/elastic-agent-system-metrics instead May 18, 2022
@kvch kvch marked this pull request as ready for review May 18, 2022 10:39
@kvch kvch requested review from a team as code owners May 18, 2022 10:39
@kvch kvch requested review from fearful-symmetry and faec and removed request for a team May 18, 2022 10:39
@kvch kvch added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label May 18, 2022
@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 18, 2022
@cmacknz
Copy link
Member

cmacknz commented May 18, 2022

As usual I just spot checked this, we'll have to rely on CI to find any unexpected problems.

@kvch
Copy link
Contributor Author

kvch commented May 18, 2022

I will fix crosscompiling issues in elastic-agent-system-metrics.

@fearful-symmetry
Copy link
Contributor

@kvch just to make sure I'm on the same page, is the plan to migrate + remove the metrics code in libbeat/internal in a different set of PRs?

@kvch
Copy link
Contributor Author

kvch commented May 20, 2022

just to make sure I'm on the same page, is the plan to migrate + remove the metrics code in libbeat/internal in a different set of PRs?

Yes. If that works for you.

@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 use-system-metrics-lib upstream/use-system-metrics-lib
git merge upstream/main
git push upstream use-system-metrics-lib

@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 use-system-metrics-lib upstream/use-system-metrics-lib
git merge upstream/main
git push upstream use-system-metrics-lib

@kvch kvch merged commit ae50f3a into elastic:main May 23, 2022
@elasticmachine
Copy link
Collaborator

💚 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!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants