-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
6c3c47d
bb65f20
6e4220d
20b36fc
94a780a
f89948c
5fc2efd
ad4f627
ebffcd7
d9f3e53
276dd19
3073e64
b8e6ea5
cbf1c24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In any case, we cannot add a new tag unconditionally... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I understand your point of view. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. up ? ;-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's why we prefer "lists" of what to add instead of boolean options. This way we have one option with many potential values. For this plugin there actually already is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. |
||
children = append(children, processGroup{ | ||
processes: c, | ||
tags: tags, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -495,7 +495,7 @@ func (p *Procstat) findSupervisorUnits() ([]PidsTags, error) { | |
if err != nil { | ||
return nil, fmt.Errorf("getting children for %d failed: %w", pid, err) | ||
} | ||
tags := map[string]string{"pattern": p.Pattern, "parent_pid": p.Pattern} | ||
tags := map[string]string{"pattern": p.Pattern, "parent_pid": p.Pattern, "child_level": p.Pattern} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to conditionally add the |
||
|
||
// Handle situations where the PID does not exist | ||
if len(pids) == 0 { | ||
|
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 are you removing this here?