Zane/fix fluentd procstat pattern#1662
Merged
zanejohnson-azure merged 5 commits intoci_prodfrom Apr 28, 2026
Merged
Conversation
Previously exe=ruby matched both fluentd PIDs (supervisor + worker) since both resolve to /usr/bin/ruby, producing identical metrics. Now uses distinct pattern matching: - fluentd supervisor: pattern = "fluentd(?!.*under-supervisor)" - fluentd worker: pattern = "fluentd.*under-supervisor" Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Go regex (used by procstat) does not support lookaheads (?!...). Change supervisor pattern from fluentd(?!.*under-supervisor) to "ruby /usr/bin/fluentd" which only matches the supervisor cmdline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…/worker Replace pattern-based matching with [[inputs.procstat.filter]] using process_names which matches against /proc/pid/comm. This cleanly separates fluentd supervisor (comm=fluentd) from worker (comm=ruby). Validated via fast-test on zane-ama-logs-helm-test cluster. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
suyadav1
reviewed
Apr 27, 2026
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
suyadav1
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
problem 1
both ruby and fluentd has the keyword "ruby" and "fluentd" in its cmdline, so using pattern can't tell who is who. also using exe as filter does not work either, because fluentd is a gem under ruby, so the exe of fluentd process is also ruby.
fix: use procstat.filter doc: https://docs.influxdata.com/telegraf/v1/input-plugins/procstat/#:~:text=This%20plugin%20allows%20to%20monitor,service%20that%20started%20the%20process.
tested, now values of fluentd and ruby matches what is showing inside container
manual check
fluentd (supervisor): 47.9 MB
ruby: 82.5 MB
problem 2:
main telegraf and the process metrics collection telegraf both use telegraf.exe so exe can be differentiate whether the telegraf process is main or process-metrics.
fix: The only difference is the telegraf config files, so we can use pattern to differentiate between them.
problem 3:
add a ProcessName field to make query easier.
test