-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[receiver/hostmetricsreceiver] add process.parent_pid attribute to process metrics #12637
Conversation
return -1, err | ||
} | ||
|
||
// if a process does not have a parent return the pid of the process as it's own parent |
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.
this should not happen but gops does report some processes as having no parent.
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.
Why returning process's PID as parent PID? Is this some adopted fallback?
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.
Yes, just using it as a fallback. I don't think it's serious enough of an error to report or fail the scrape.
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.
Shouldn't it be 0
as it mostly represents no parent AFAIR?
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.
Technically speaking every process should have a parent. If no immediate relative is found then pid 1 (init process) becomes the parent. I can set it to 0 though. Would like to avoid using 1 so that we can distinguish between processes where the parent is clearly identified vs processes where we were not able to identify the parent.
receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go
Show resolved
Hide resolved
return -1, err | ||
} | ||
|
||
// if a process does not have a parent return the pid of the process as it's own parent |
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.
Why returning process's PID as parent PID? Is this some adopted fallback?
Issue created in opentelemtry-specification repo to add parent.process_id to spec open-telemetry/opentelemetry-specification#2689 |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Description:
added process.parent_pid to hostmetricsreceiver process attributes
Link to tracking Issue:
#12290
Testing:
Ran on ubuntu box
Documentation:
n/a
cc: @dmitryax