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

[receiver/hostmetricsreceiver] add process.parent_pid attribute to process metrics #12637

Merged
merged 7 commits into from
Aug 8, 2022

Conversation

davidmirza408
Copy link
Contributor

Description:
added process.parent_pid to hostmetricsreceiver process attributes

Link to tracking Issue:
#12290

Testing:
Ran on ubuntu box

Documentation:
n/a

cc: @dmitryax

return -1, err
}

// if a process does not have a parent return the pid of the process as it's own parent
Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

unreleased/hostmetrics-receiver-ppid-attribute.yaml Outdated 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
Copy link
Member

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?

@davidmirza408
Copy link
Contributor Author

Issue created in opentelemtry-specification repo to add parent.process_id to spec open-telemetry/opentelemetry-specification#2689

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2022

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Aug 6, 2022
@dmitryax dmitryax removed the Stale label Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants