Skip to content

in_windows_exporter_metrics: Add description for performance metrics#2610

Open
cosmo0920 wants to merge 1 commit into
masterfrom
cosmo0920-add-docs-for-user-defined-performance-counters
Open

in_windows_exporter_metrics: Add description for performance metrics#2610
cosmo0920 wants to merge 1 commit into
masterfrom
cosmo0920-add-docs-for-user-defined-performance-counters

Conversation

@cosmo0920

@cosmo0920 cosmo0920 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The corresponding PR is:
fluent/fluent-bit#12006

Summary by CodeRabbit

  • Documentation
    • Added support details for the new performancecounter collector, including it in the “Collectors available” list.
    • Documented per-collector collector.performancecounter.scrape_interval overrides and repeatable PerformanceCounter mappings using name=counter_path.
    • Explained exported gauge metric naming (windows_performancecounter_<metric_name>), the instance label, and wildcard expansion of counter paths at startup.
    • Updated requirements/permissions to reflect use of both WMI and PDH, plus querying the configured performance counters.
    • Corrected an item in the “Advanced usage” section.

Comment thread pipeline/inputs/windows-exporter-metrics.md Outdated
Comment thread pipeline/inputs/windows-exporter-metrics.md Outdated
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de01a834-4e19-400c-9a2e-aa190fcd6aa0

📥 Commits

Reviewing files that changed from the base of the PR and between ae7add1 and a5445db.

📒 Files selected for processing (1)
  • pipeline/inputs/windows-exporter-metrics.md
✅ Files skipped from review due to trivial changes (1)
  • pipeline/inputs/windows-exporter-metrics.md

📝 Walkthrough

Walkthrough

The Windows exporter metrics documentation now covers performancecounter configuration, custom counter usage, permission requirements, and a numbering fix in advanced usage.

Changes

Windows exporter metrics documentation

Layer / File(s) Summary
Reference tables
pipeline/inputs/windows-exporter-metrics.md
Adds collector.performancecounter.scrape_interval, repeatable PerformanceCounter entries, and a performancecounter collector description in the reference tables.
Custom counter usage
pipeline/inputs/windows-exporter-metrics.md
Adds a section for custom performance counters, including configuration format, exported gauge naming, wildcard instance labels, and WMI/PDH permissions.
Advanced usage correction
pipeline/inputs/windows-exporter-metrics.md
Renumbers the we.service.where item in the advanced usage list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hops through docland light,
With counters named and paths in sight.
WMI and PDH hum along,
While we.service.where keeps the song.
ᕱᕱ ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main doc update: adding performance counter metrics support to windows_exporter_metrics.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cosmo0920-add-docs-for-user-defined-performance-counters

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
pipeline/inputs/windows-exporter-metrics.md (2)

62-63: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix table column alignment and use lowercase key name in parameter table.

The table pipes are misaligned with the header (markdownlint MD060). Additionally, per the documented convention, parameter tables should use canonical lowercase key names. The table entry PerformanceCounter should be performancecounter to match the convention where classic config examples use Title_Case and YAML uses snake_case.

-| `collector.performancecounter.scrape_interval` | The rate in seconds at which `performancecounter` metrics are collected. Values greater than `0` override the global default. Otherwise, the global default is used. | `0`                                                                 |
-| `PerformanceCounter`                     | Define a Windows Performance Counter to collect. This key can be specified multiple times. Use the `name=counter_path` form.                                   | _none_                                                                   |
+| `collector.performancecounter.scrape_interval` | The rate in seconds at which `performancecounter` metrics are collected. Values greater than `0` override the global default. Otherwise, the global default is used. | `0`                                                                      |
+| `performancecounter`                       | Define a Windows Performance Counter to collect. This key can be specified multiple times. Use the `name=counter_path` form.                                     | _none_                                                                   |

As per coding guidelines, parameter tables should document the canonical lowercase key names.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/inputs/windows-exporter-metrics.md` around lines 62 - 63, The
parameter table has a Markdown alignment issue and one key uses the wrong
casing. Update the table in windows-exporter-metrics so the pipes align cleanly
with the header, and rename the `PerformanceCounter` entry to the canonical
lowercase `performancecounter` to match the documented parameter naming
convention.

Source: Learnings


89-89: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix table column alignment.

The table pipe alignment is off (markdownlint MD060). Adjust spacing to match the header column widths.

-| `performancecounter` | Exposes user-defined Windows Performance Counters through PDH.                                       | Windows | v5.0.8  |
+| `performancecounter` | Exposes user-defined Windows Performance Counters through PDH.                                       | Windows | v5.0.8 |

Also consider expanding PDH on first use for clarity: "Performance Data Helper (PDH)".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/inputs/windows-exporter-metrics.md` at line 89, The Windows exporter
metrics table row for performancecounter is misaligned with the header, causing
markdownlint MD060; update the spacing in that table entry so the pipe columns
line up with the existing header widths. While touching this row, expand the PDH
acronym on first use in the description by using the full “Performance Data
Helper (PDH)” wording for clarity.
🧹 Nitpick comments (2)
pipeline/inputs/windows-exporter-metrics.md (2)

430-430: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use sentence-style capitalization for consistency.

Change to "Custom performance counters" to align with the sentence-style capitalization used in the "Custom scrape intervals per collector" heading (line 392).

-### Custom Performance Counters
+### Custom performance counters

As per path instructions, the vale style checker flags this heading.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/inputs/windows-exporter-metrics.md` at line 430, The heading “Custom
Performance Counters” uses title-style capitalization and is flagged by the vale
style checker; update the heading text in the markdown section to sentence-style
capitalization to match “Custom scrape intervals per collector” and the rest of
the document’s heading convention.

432-432: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Define PDH on first use or move definition earlier.

PDH is first used at line 89 ("through PDH") and again at line 432, but not defined until line 483 ("Performance Data Helper (PDH)"). Either expand PDH at line 89 or move the definition earlier.

-Exposes user-defined Windows Performance Counters through PDH.
+Exposes user-defined Windows Performance Counters through Performance Data Helper (PDH).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/inputs/windows-exporter-metrics.md` at line 432, The acronym PDH is
used before it is defined in the `windows-exporter-metrics` content, so update
the earlier `performancecounter` description to expand PDH on first use or move
the “Performance Data Helper (PDH)” definition earlier in the document. Make
sure the first occurrences around the `performancecounter` collector section and
the later PDH definition stay consistent and readable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@pipeline/inputs/windows-exporter-metrics.md`:
- Around line 62-63: The parameter table has a Markdown alignment issue and one
key uses the wrong casing. Update the table in windows-exporter-metrics so the
pipes align cleanly with the header, and rename the `PerformanceCounter` entry
to the canonical lowercase `performancecounter` to match the documented
parameter naming convention.
- Line 89: The Windows exporter metrics table row for performancecounter is
misaligned with the header, causing markdownlint MD060; update the spacing in
that table entry so the pipe columns line up with the existing header widths.
While touching this row, expand the PDH acronym on first use in the description
by using the full “Performance Data Helper (PDH)” wording for clarity.

---

Nitpick comments:
In `@pipeline/inputs/windows-exporter-metrics.md`:
- Line 430: The heading “Custom Performance Counters” uses title-style
capitalization and is flagged by the vale style checker; update the heading text
in the markdown section to sentence-style capitalization to match “Custom scrape
intervals per collector” and the rest of the document’s heading convention.
- Line 432: The acronym PDH is used before it is defined in the
`windows-exporter-metrics` content, so update the earlier `performancecounter`
description to expand PDH on first use or move the “Performance Data Helper
(PDH)” definition earlier in the document. Make sure the first occurrences
around the `performancecounter` collector section and the later PDH definition
stay consistent and readable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 41c7ab5e-44bd-41a5-ab4a-db0291a4c8df

📥 Commits

Reviewing files that changed from the base of the PR and between 4e2f445 and 870296a.

📒 Files selected for processing (1)
  • pipeline/inputs/windows-exporter-metrics.md

@eschabell eschabell self-assigned this Jun 26, 2026
@eschabell eschabell added waiting-on-code-merge waiting-on-review Waiting on a review from mainteners labels Jun 26, 2026
@eschabell eschabell force-pushed the cosmo0920-add-docs-for-user-defined-performance-counters branch from 870296a to 996a855 Compare June 26, 2026 11:36
Comment thread pipeline/inputs/windows-exporter-metrics.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
pipeline/inputs/windows-exporter-metrics.md (3)

63-63: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Use canonical lowercase key name and clarify metric name placeholder.

Per the repository convention, parameter tables should document canonical lowercase key names. The table currently shows PerformanceCounter (Title_Case); it should be performancecounter.

Additionally, the description says name=counter_path, but the example and surrounding text use metric_name. Clarify that the metric name is user-defined, or align the description with metric_name.

📝 Proposed fix
-| `PerformanceCounter`                           | Define a Windows Performance Counter to collect. This key can be specified multiple times. Use the `name=counter_path` form.                                         | _none_                                                                             |
+| `performancecounter`                           | Define a Windows Performance Counter to collect. This key can be specified multiple times. Use the `<metric_name>=<counter_path>` form.                                | _none_                                                                             |

Based on learnings: "Parameter tables should document the canonical lowercase key names."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/inputs/windows-exporter-metrics.md` at line 63, The parameter table
entry in windows-exporter-metrics.md uses a non-canonical key name and
inconsistent placeholder text. Update the PerformanceCounter row to use the
canonical lowercase key name in the left column, and align the description with
the surrounding metric naming convention by replacing the ambiguous
name=counter_path wording with metric_name or a clear note that the metric name
is user-defined.

Source: Learnings


89-89: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Expand PDH on first use.

"PDH" appears at line 89 without expansion. The first expansion of "Performance Data Helper (PDH)" occurs much later at line 483. Readers encountering this acronym in the collectors table will not know what it means.

📝 Proposed fix
-| `performancecounter` | Exposes user-defined Windows Performance Counters through PDH.                                              | Windows | v5.0.8  |
+| `performancecounter` | Exposes user-defined Windows Performance Counters through Performance Data Helper (PDH).                     | Windows | v5.0.8  |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/inputs/windows-exporter-metrics.md` at line 89, The collectors table
entry for performancecounter uses the acronym PDH before it is defined, so
update that description in windows-exporter-metrics.md to spell out Performance
Data Helper (PDH) on first mention. Keep the later full explanation consistent,
and ensure the collectors table remains readable without requiring readers to
find the later expansion.

430-430: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Use sentence-style capitalization for heading.

Per the documentation style guide, headings should use sentence-style capitalization: "Custom performance counters".

📝 Proposed fix
-### Custom Performance Counters
+### Custom performance counters
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pipeline/inputs/windows-exporter-metrics.md` at line 430, The heading in the
documentation uses title case instead of sentence-style capitalization. Update
the “Custom Performance Counters” heading in the markdown content to match the
style guide by using “Custom performance counters”; keep the change localized to
that heading so the surrounding documentation stays unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pipeline/inputs/windows-exporter-metrics.md`:
- Line 43: Fix the wording in the `we.service.include` documentation entry so
the description uses “key-value pairs” instead of “key value pairs.” Update the
markdown table text in the windows exporter metrics docs and keep the rest of
the sentence unchanged.

---

Nitpick comments:
In `@pipeline/inputs/windows-exporter-metrics.md`:
- Line 63: The parameter table entry in windows-exporter-metrics.md uses a
non-canonical key name and inconsistent placeholder text. Update the
PerformanceCounter row to use the canonical lowercase key name in the left
column, and align the description with the surrounding metric naming convention
by replacing the ambiguous name=counter_path wording with metric_name or a clear
note that the metric name is user-defined.
- Line 89: The collectors table entry for performancecounter uses the acronym
PDH before it is defined, so update that description in
windows-exporter-metrics.md to spell out Performance Data Helper (PDH) on first
mention. Keep the later full explanation consistent, and ensure the collectors
table remains readable without requiring readers to find the later expansion.
- Line 430: The heading in the documentation uses title case instead of
sentence-style capitalization. Update the “Custom Performance Counters” heading
in the markdown content to match the style guide by using “Custom performance
counters”; keep the change localized to that heading so the surrounding
documentation stays unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aac7f365-2e59-4b38-b61c-e5610b94fdea

📥 Commits

Reviewing files that changed from the base of the PR and between 870296a and 996a855.

📒 Files selected for processing (1)
  • pipeline/inputs/windows-exporter-metrics.md

Comment thread pipeline/inputs/windows-exporter-metrics.md Outdated
@eschabell eschabell force-pushed the cosmo0920-add-docs-for-user-defined-performance-counters branch from 996a855 to ae7add1 Compare June 27, 2026 11:31
@eschabell

Copy link
Copy Markdown
Collaborator

Fixing a few listing and ai issues.

… performance metrics

   - Fixed linting errors.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Eric D. Schabell <eric@schabell.org>
@eschabell eschabell force-pushed the cosmo0920-add-docs-for-user-defined-performance-counters branch from ae7add1 to a5445db Compare June 27, 2026 11:35

@eschabell eschabell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@cosmo0920 fixed some listing and other ai uncovered issue, but now good to go when code PR merges.

Comment thread pipeline/inputs/windows-exporter-metrics.md Outdated
@eschabell eschabell removed the waiting-on-review Waiting on a review from mainteners label Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants