Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 81 additions & 36 deletions src/pages/integrations/windows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ If you are only interested in shipping metrics, you can skip the Logs section an

### Install Integration

<InstallIntegration/>
<InstallIntegration type="metrics"/>

### Install Telegraf

Expand Down Expand Up @@ -105,63 +105,105 @@ If you are only interested in shipping metrics, you can skip the Logs section an
If you are logged into your Logit.io account the fields should have been pre-populated with the correct values.

```toml copy
# Input plugin to report Windows services info.
# This plugin ONLY supports Windows
[[inputs.win_services]]
## Names of the services to monitor. Leave empty to monitor all the available services on the host. Globs accepted. Case sensitive.
service_names = [
"LanmanServer",
"TermService",
"Win*",
]
excluded_service_names = ['WinRM'] # optional, list of service names to exclude

###############################################################################
# Windows Performance Counters plugin.
# These are the recommended method of monitoring system metrics on windows,
# as the regular system plugins (inputs.cpu, inputs.mem, etc.) rely on WMI,
# which utilize more system resources.
#
# See more configuration examples at:
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters
# INPUTS #
###############################################################################
[[inputs.win_perf_counters]]
[[inputs.win_perf_counters.object]]
# Processor usage, alternative to native, reports on a per core.
ObjectName = "Processor"
Instances = ["*"]
Instances = ["_Total"]
Counters = [
"% Idle Time",
"% Interrupt Time",
"% Privileged Time",
"% User Time",
"% Processor Time",
"% DPC Time",
]
Measurement = "win_cpu"
# 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]]
# Process metrics, in this case for IIS only
ObjectName = "Process"
Counters = [
"% Processor Time",
"Handle Count",
"Private Bytes",
"Thread Count",
"Virtual Bytes",
"Working Set"
]
Instances = ["w3wp", "dfmserver", "dfmwatchdog", "java", "httpd", "TrendScan", "TmListen", "CNTAoSMgr"]
Measurement = "win_proc"
#IncludeTotal=false #Set to true to include _Total instance when querying for all ().
[[inputs.win_perf_counters.object]]
# 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]]
Comment on lines 143 to +158
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.

ObjectName = "PhysicalDisk"
Instances = ["*"]
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",
]
Measurement = "win_diskio"
[[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
[[inputs.win_perf_counters.object]]
ObjectName = "Network Interface"
Instances = ["*"]
Counters = [
"Bytes Received/sec",
"Bytes Sent/sec",
"Packets Received/sec",
"Packets Sent/sec",
"Packets Received Discarded",
"Packets Outbound Discarded",
"Packets Received Errors",
"Packets Outbound Errors",
]
Measurement = "win_net"
[[inputs.win_perf_counters.object]]
ObjectName = "System"
Counters = [
"Threads",
"Processes",
"Context Switches/sec",
"System Calls/sec",
"Processor Queue Length",
"System Up Time",
]
Instances = ["------"]
Measurement = "win_system"
# Set to true to include _Total instance when querying for all (*).
# Set to true to include _Total instance when querying for all ().
#IncludeTotal=false
[[inputs.win_perf_counters.object]]
# Example query where the Instance portion must be removed to get data back,
Expand All @@ -173,16 +215,20 @@ If you are only interested in shipping metrics, you can skip the Logs section an
"Demand Zero Faults/sec",
"Page Faults/sec",
"Pages/sec",
"Page Reads/sec",
"Page Writes/sec",
"Transition Faults/sec",
"Pool Nonpaged Bytes",
"Pool Paged Bytes",
"Standby Cache Reserve Bytes",
"Standby Cache Normal Priority Bytes",
"Standby Cache Core Bytes",
]
# Use 6 x - to remove the Instance bit from the query.
Instances = ["------"]
Measurement = "win_mem"
# Set to true to include _Total instance when querying for all (*).
#IncludeTotal=false

[[inputs.win_perf_counters.object]]
# Example query where the Instance portion must be removed to get data back,
# such as from the Paging File object.
Expand All @@ -192,14 +238,13 @@ If you are only interested in shipping metrics, you can skip the Logs section an
]
Instances = ["_Total"]
Measurement = "win_swap"

[[outputs.http]]
url = "https://@metricsUsername:@metricsPassword@@metrics_id-vm.logit.io:@vmAgentPort/api/v1/write"
data_format = "prometheusremotewrite"

[outputs.http.headers]
Content-Type = "application/x-protobuf"
Content-Encoding = "snappy"
[[outputs.http]]
url = "https://@metricsUsername:@metricsPassword@@metrics_id-vm.logit.io:@vmAgentPort/api/v1/write"
data_format = "prometheusremotewrite"

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

<Callout type="info">
Expand Down