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

feat(inputs.procstat): Add child level tag #16105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tguenneguez
Copy link
Contributor

@tguenneguez tguenneguez commented Oct 29, 2024

Summary

Add tag for children process to be able to have information by level

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16104

@telegraf-tiger telegraf-tiger bot added area/procstat feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Oct 29, 2024
@telegraf-tiger
Copy link
Contributor

Copy link
Member

@DStrand1 DStrand1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I have one code question, but also does this close issue #16104? If so could you update the PR description to close the issue? Thanks!

@@ -202,6 +202,7 @@ func (f *Filter) ApplyFilter() ([]processGroup, error) {
tags[k] = v
}
tags["parent_pid"] = strconv.FormatInt(int64(p.Pid), 10)
tags["child_level"] = strconv.FormatInt(int64(depth), 10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a configuration option since it is a new tag

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree as it will also likely produce high cardinality. How about adding this as a field instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the cardinality is higher on the parent_pid field so this change is less impactful than one might think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, we cannot add a new tag unconditionally...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I understand your point of view.
What option would you suggest to add this tag?
Is there a naming rule?
It also means that for each plugin each time new tags are added, an option is needed. Is this likely to create plugins with long configurations?
We could put:
tag_child_level.
If not defined, the tag is not added.
If tag_child_level=toto then the level is added in the tag "toto"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up ? ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a configuration option since it is a new tag
@DStrand1 Have you a name recommanded for activate new tag ?

@DStrand1 DStrand1 self-assigned this Oct 29, 2024
@tguenneguez
Copy link
Contributor Author

Thanks for the PR! I have one code question, but also does this close issue #16104?

Yes it's the same. The issue is in the PR description.

What do you understand exactly by :

If so could you update the PR description to close the issue? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/procstat feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(inputs.procstat): Add child level tag
3 participants