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

Add GetOneRootEvent method to process handler #150

Merged
merged 4 commits into from
May 10, 2024

Conversation

fearful-symmetry
Copy link
Contributor

What does this PR do?

This is part of elastic/elastic-agent#4083

This adds a GetOneRootEvent(). method to ProcStats we need this for elastic/elastic-agent#4083 , as that issue requires metricbeat's system/process metricset to monitor a specific PID, which it can't do now. This will have to be followed up with a change to beat itself to rope this in. This also cleans up a bit of code and adds some docs.

Why is it important?

needed for elastic/elastic-agent#4083

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.md

@fearful-symmetry fearful-symmetry added the Team:Elastic-Agent Label for the Agent team label May 9, 2024
@fearful-symmetry fearful-symmetry self-assigned this May 9, 2024
@fearful-symmetry fearful-symmetry requested a review from a team as a code owner May 9, 2024 15:50
@fearful-symmetry fearful-symmetry requested review from AndersonQ and faec and removed request for a team May 9, 2024 15:50
@cmacknz cmacknz requested review from belimawr and removed request for AndersonQ May 9, 2024 19:06
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label May 10, 2024
@pierrehilbert pierrehilbert requested a review from a team May 10, 2024 06:33
metric/system/process/process_test.go Outdated Show resolved Hide resolved
@fearful-symmetry fearful-symmetry requested a review from belimawr May 10, 2024 13:28
@fearful-symmetry fearful-symmetry merged commit f6572de into elastic:main May 10, 2024
5 checks passed
fearful-symmetry added a commit that referenced this pull request May 17, 2024
## What does this PR do?

This fixes a small bug introduced in #150, where we weren't setting the
`ProcState` object while creating the root event.

This is needed for elastic/beats#39620

## Why is it important?

The previous PR adds fields that weren't in events before, this fixes
that.

## Checklist

- [x] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added an entry in `CHANGELOG.md`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team 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.

3 participants