Skip to content

Conversation

@pwatson-logit
Copy link
Contributor

This PR makes some improvements to the Windows system metrics, to work with the new Windows metrics dashboard in Grafana. (See https://github.com/logit-io/logit-dashboard/pull/968).

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 12, 2025

Summary by CodeRabbit

  • Documentation
    • Windows integration guide now defaults to metrics-only installation via an updated Install Integration step.
    • Sample configuration expanded to capture broader telemetry: CPU, processes, memory, disk (logical and physical), network, and system metrics (e.g., queue length, page reads/writes, free space, disk I/O, uptime, threads/processes).
    • Removed Windows Services monitoring example to focus on metrics.
    • Remote-write output section clarified and reorganized with improved formatting and comments.

Walkthrough

Documentation update to src/pages/integrations/windows.mdx: shifts InstallIntegration to metrics-only usage and substantially revises the Telegraf Windows performance counters sample config. Removes win_services, expands CPU/process/disk/network/system/memory/paging metrics, adds PhysicalDisk and Network Interface objects, and moves outputs.http to a top-level block.

Changes

Cohort / File(s) Summary of Changes
Windows integration docs
src/pages/integrations/windows.mdx
Updated InstallIntegration usage to <InstallIntegration type="metrics" />. Overhauled Telegraf perf counters: removed win_services; CPU instances to _Total with added % DPC Time; added Process object (w3wp, java, httpd, etc.); enhanced LogicalDisk (IncludeTotal, % Free Space, Free MB); added PhysicalDisk (win_diskio); added Network Interface (win_net); expanded System (Threads, Processes, Queue Length, Uptime); expanded Memory (Page Reads/Writes, Standby Cache); retained Paging File (win_swap). Moved outputs.http to top-level. Formatting and comments adjusted.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • Mike-Logit
  • ccottam
  • ChrisAdams-Logit
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch windows_system_metrics_update

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai bot added the documentation Improvements or additions to documentation label Aug 12, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (3)
src/pages/integrations/windows.mdx (3)

100-106: Update text: sample config no longer includes Windows Services.

The paragraph says the config “includes plugins for both Windows Performance Counters and Windows Services,” but there’s no [[inputs.win_services]] block below. Adjust the copy to avoid confusing users.

Apply:

-  It includes plugins for both Windows Performance Counters and Windows Services and specifies the output configuration
-  for sending your data to Logit.io.
+  It includes plugins for Windows Performance Counters and specifies the output configuration
+  for sending your data to Logit.io.

254-256: Remove or reframe the Windows Services callout.

Since the sample config omits [[inputs.win_services]], linking to that plugin here implies it’s used. Either remove the callout or add a dedicated section with a minimal win_services example if still relevant.

Example to remove:

-  <Callout type="info">
-    Read more about how to configure data scraping and configuration options for Windows Services [here](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_services)
-  </Callout>

Or add a small win_services block if the dashboard includes service status panels.


268-270: Fix quoting for the --config path in PowerShell test command.

Mixed quoting (C:"Program Files"...) is error-prone. Use a single quoted or double-quoted full path.

-  .\telegraf.exe `
-  --config C:\"Program Files"\InfluxData\telegraf\telegraf.conf --test
+  .\telegraf.exe `
+    --config "C:\Program Files\InfluxData\telegraf\telegraf.conf" `
+    --test
🧹 Nitpick comments (5)
src/pages/integrations/windows.mdx (5)

115-127: Clarify intent for CPU instances vs IncludeTotal.

With Instances = ["_Total"], setting IncludeTotal = true is redundant. If you want per-core + total for dashboards, set Instances = ["*"] and IncludeTotal = true. If the dashboard expects only _Total, keep Instances = ["_Total"] and drop IncludeTotal.

Option A (total only):

       Measurement = "win_cpu"
-      # Set to true to include _Total instance when querying for all ().
-      IncludeTotal=true

Option B (per-core + total):

-      Instances = ["_Total"]
+      Instances = ["*"]
       Measurement = "win_cpu"
-      # Set to true to include _Total instance when querying for all ().
-      IncludeTotal=true
+      # Include _Total alongside per-core instances.
+      IncludeTotal = true

Please confirm which aligns with the Grafana panels in logit-dashboard#968.


128-141: Process instances list and comment mismatch; consider broader capture.

Comment says “IIS only” but you enumerate IIS and non-IIS processes (java, httpd, TrendMicro). Hard-coding names is brittle and environment-specific.

  • If dashboards are built for system-wide process metrics, prefer Instances = ["*"] and filter/group in Grafana.
  • If only IIS worker processes are needed, narrow to Instances = ["w3wp"] and fix the comment.

Example for broad capture:

-      # Process metrics, in this case for IIS only
+      # Process metrics (all processes; filter in dashboard as needed)
       ObjectName = "Process"
@@
-      Instances = ["w3wp", "dfmserver", "dfmwatchdog", "java", "httpd", "TrendScan", "TmListen", "CNTAoSMgr"]
+      Instances = ["*"]

Confirm what the updated dashboard expects.


159-171: PhysicalDisk counters look good; consider read/write queue counters if needed.

The selected counters are solid for IO throughput and latency. If the dashboard benefits from per-direction queue metrics, you could also include “Avg. Disk Read Queue Length” and “Avg. Disk Write Queue Length.”

       Counters = [
         "Disk Read Bytes/sec",
         "Disk Write Bytes/sec",
         "Avg. Disk Queue Length",
         "Current Disk Queue Length",
         "Avg. Disk sec/Read",
         "Avg. Disk sec/Write",
         "Split IO/sec",
+        "Avg. Disk Read Queue Length",
+        "Avg. Disk Write Queue Length",
       ]

205-207: Minor: fix misleading comment about IncludeTotal with “------”.

The note mentions including _Total “when querying for all (*)” but this block uses Instances = ["------"] (to remove instance dimension). Update the comment to avoid confusion.

-      # Set to true to include _Total instance when querying for all ().
-      #IncludeTotal=false
+      # Note: Instances = ["------"] removes the instance dimension for this object.
+      # IncludeTotal is not applicable here.
+      #IncludeTotal = false

79-86: Consider clarifying the two-step download/extract instruction.

The note “press enter after the initial download command to run the extract command” suggests two separate commands; but they’re already separate lines. Optionally reword to “Run the following two commands in sequence” for clarity.

-  and then extract that into `C:\Program Files\InfluxData\telegraf\telegraf-1.33.0`. (You will need 
-  to press enter after the initial download command to run the extract command).
+  and then extract it into `C:\Program Files\InfluxData\telegraf\telegraf-1.33.0`. Run the following two commands in sequence.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec4aab1 and 612c923.

📒 Files selected for processing (1)
  • src/pages/integrations/windows.mdx (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-04T11:54:28.144Z
Learnt from: pwatson-logit
PR: logit-io/docs-content#116
File: src/pages/integrations/windows.mdx:217-219
Timestamp: 2025-07-04T11:54:28.144Z
Learning: In Telegraf, the service install command uses the syntax `service install` without dashes. The `--service` flag has been deprecated in newer versions of Telegraf.

Applied to files:

  • src/pages/integrations/windows.mdx
🔇 Additional comments (6)
src/pages/integrations/windows.mdx (6)

71-71: Use of metrics-only InstallIntegration looks correct.

Switching to aligns with a metrics-focused path and the PR objective to support the new Grafana dashboard.


195-207: System counters: verify “System Calls/sec” availability on target Windows versions.

Some environments don’t expose “System Calls/sec” by default or it may vary by OS/version. Ensure the dashboard and users’ hosts have this counter to avoid empty series.

Would you like me to prepare a quick PowerShell snippet users can run to validate these counters exist on their hosts?


212-226: Memory counters: looks comprehensive.

The chosen counters (Available Bytes, Pages/sec, Page Reads/Writes/sec, Standby Cache) cover typical dashboard needs.


262-265: Service installation syntax is correct per current Telegraf guidance.

Using “service install” (without deprecated flags) matches our prior learning and current Telegraf behavior.


80-86: Optional: verify Telegraf version.

1.33.0 is fine, but if a newer stable (or security) release exists, consider updating to match current support.

Would you like me to check the latest Telegraf Windows release and propose an updated command set if newer?


241-247: Use Basic Auth fields in outputs.http
File: src/pages/integrations/windows.mdx (lines 241–247)

Embedding credentials in the URL can break when passwords contain special characters (e.g., @, :, /) and may expose them in logs. The outputs.http plugin supports explicit username/password keys for Basic Auth.

• Replace the embedded credentials in the url with separate username and password fields.
• Verify that your MDX templating (the @@metrics_id syntax, etc.) renders a single @ in the final output.

Proposed diff:

@@ src/pages/integrations/windows.mdx:241-247
   [[outputs.http]]
-    url = "https://@metricsUsername:@metricsPassword@@metrics_id-vm.logit.io:@vmAgentPort/api/v1/write"
+    url      = "https://@metrics_id-vm.logit.io:@vmAgentPort/api/v1/write"
+    username = "@metricsUsername"
+    password = "@metricsPassword"
     data_format = "prometheusremotewrite"

     [outputs.http.headers]
       Content-Type     = "application/x-protobuf"
       Content-Encoding = "snappy"

Please confirm that your site build correctly replaces @metricsUsername, @metricsPassword, @metrics_id, and @vmAgentPort, and that the Basic Auth fields work with your dashboard.

Comment on lines 143 to +158
# Disk times and queues
ObjectName = "LogicalDisk"
Instances = ["*"]
Counters = [
"% Idle Time",
"% Disk Time","% Disk Read Time",
"% Disk Time",
"% Disk Read Time",
"% Disk Write Time",
"% User Time",
"Current Disk Queue Length",
"% Free Space",
"Free Megabytes",
]
Measurement = "win_disk"
# Set to true to include _Total instance when querying for all (*).
#IncludeTotal=false
# Set to true to include _Total instance when querying for all ().
#IncludeTotal=true
[[inputs.win_perf_counters.object]]
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Duplicate LogicalDisk objects/metrics; consolidate to avoid duplicate series.

LogicalDisk is defined twice, both with Measurement = "win_disk", and the first already includes “% Free Space” and “Free Megabytes”. This will emit duplicate metrics for those counters and can complicate dashboards.

Consolidate into a single LogicalDisk block with IncludeTotal = true, and keep all desired counters. For example:

   [[inputs.win_perf_counters.object]]
     # Disk times and queues
     ObjectName = "LogicalDisk"
-    Instances = ["*"]
+    Instances = ["*"]
     Counters = [
       "% Idle Time",
-      "% Disk Time",
-      "% Disk Read Time",
+      "% Disk Time",
+      "% Disk Read Time",
       "% Disk Write Time",
       "Current Disk Queue Length",
       "% Free Space",
       "Free Megabytes",
     ]
     Measurement = "win_disk"
-    # Set to true to include _Total instance when querying for all ().
-    #IncludeTotal=true
-  [[inputs.win_perf_counters.object]]
-    ObjectName = "LogicalDisk"
-    Instances = ["*"]            
-    Counters = [
-      "% Free Space",
-      "Free Megabytes"
-    ]
-    Measurement = "win_disk"
-    IncludeTotal = true          # Optional, but will add an aggregate "_Total" instance
+    # Include aggregate "_Total" instance
+    IncludeTotal = true

Also applies to: 172-180

🤖 Prompt for AI Agents
In src/pages/integrations/windows.mdx around lines 143-158 (also applies to
172-180), there are two LogicalDisk win_perf_counters.object blocks both using
Measurement = "win_disk" which will produce duplicate series for shared
counters; consolidate them into a single LogicalDisk block by merging the
Counters arrays (keep "% Free Space" and "Free Megabytes" only once), ensure
Instances and Measurement remain correct, and enable IncludeTotal=true
(uncomment or add) if you need the _Total instance, then remove the duplicate
LogicalDisk block so each counter emits only one metric series.

Copy link
Contributor

@Mike-Logit Mike-Logit left a comment

Choose a reason for hiding this comment

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

@pwatson-logit does this need testing by you? I'll leave this with you to merge once you are happy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants