-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
let the system/process metricset monitor a single PID #39620
let the system/process metricset monitor a single PID #39620
Conversation
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Sigh, looks like I introduced a bug in elastic/elastic-agent-system-metrics#150, lemme deal with that... |
This pull request is now in conflicts. Could you fix it? 🙏
|
## 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`
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one naming nit
@@ -32,6 +32,8 @@ type Config struct { | |||
IncludeCPUTicks bool `config:"process.include_cpu_ticks"` | |||
IncludePerCPU bool `config:"process.include_per_cpu"` | |||
CPUTicks *bool `config:"cpu_ticks"` // Deprecated | |||
// Pid, if set, will override the `processes` config, and only monitor a single process. | |||
Pid int `config:"process.pid"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker, but what if the config field was just pid
instead of process.pid
? It seems a little confusing having two mutually exclusive top-level fields to specify the target, but one of them lives in a subobject for other behavior settings.
Leave it this way for now, if someone asks us specifically for this we can re-evaluate. We do not want to be limited in our ability to change or remove this in the future unnecessarily. |
This pull request is now in conflicts. Could you fix it? 🙏
|
@fearful-symmetry I reverted this PR merge on main due to a linking problem, could you please have a look and check it again? |
@fearful-symmetry this might be helpful: #39714 (comment) |
@ycombinator yup, looking at things now |
a thought for later: why wasn't this caught in PR? Do we not have any tests that are building agentbeat? |
…ic#39620)" (elastic#39714) This reverts commit 05c5957.
Proposed commit message
required for elastic/elastic-agent#4083
This adds a
process.pid
config flag tosystem/process
to let the metricset monitor a single PID.This is needed for elastic/elastic-agent#4083, as we need to let metricbeat report metrics on a single process, which this metricset currently can't do.
Right now this has no documentation, as I'm not sure if we want to make this a public feature? It's a bit odd outside of our use case.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.