PerfCounterReporter is a Windows service for reporting Windows Performance Counters to SignalFx. Use this to monitor infrastructure of Windows hosts, including CPU, disk, memory and network.
This code is based on/inspired by PerfTap as a means of sending performance data to a monitoring system.
REQUIREMENTS AND DEPENDENCIES
|Windows||Windows 7+ (Desktop) or Windows Server 2008+ (Server)|
You must have admin privileges in order to install PerfCounterReporter. It will run as LOCAL SERVICE.
Download the latest release of the .MSI installer from the PerfCounterReporter releases page.
Launch the .MSI and follow the prompts to configure the installation.
After the installation process is complete, PerfCounterReporter will immediately begin sending metrics to SignalFx. Verify that metrics have arrived by looking for metrics from this host in the SignalFx catalog. If metrics do not arrive, examine the PerfCounterReporter log file for errors (details in Usage).
PerfCounterReporter.exe.config controls the configuration of PerfCounterReporter. If you installed this tool using the .MSI installer, it is not necessary to directly modify this file.
PerfCounterReporter.exe.config controls what performance counters are enabled and how often they are sampled. Paths to these counters may be absolute, relative to the current working directory of the application, or relative to the current directory of where the binaries are installed. This file also controls the configuration of how to report metrics to SignalFx.
signalFxReporter block includes the following options:
|APIToken||Your SignalFx API token.||No default.|
|SourceType||Configuration for what the "source" of metrics will be. Value must be one of
|DefaultDimensions||A hashtable of default dimensions to pass to SignalFx (see Adding Default Dimensions below).||Empty dictionary|
|AwsIntegration||If set to "true" then AWS metadata will accompany metrics.||false|
|SampleInterval||Controls the interval at which to send metrics to SignalFx, as hh:mm:ss.||00:00:05|
<signalFxReporter apiToken="<yourtoken>" sampleInterval="00:00:05" sourceType="netbios"/>
Adding default dimensions
To add dimensions that will be included in every metric emitted by PerfCounterReporter, add a nested
<defaultDimensions> block in your
<signalFxReporter> stanza. In the following example, dimensions "environment:prod" and "serverType:API" will be included in all metrics:
<signalFxReporter apiToken="AAABQWDCC" sourceType="netbios" sampleInterval="00:00:05"> <defaultDimensions> <defaultDimension name="environment" value="prod"/> <defaultDimension name="serverType" value="API"/> </defaultDimensions> </signalFxReporter>
Selecting counter sets
counterSampling block includes the following options:
|definitionFilePaths||List of file paths with counter definitions (see Selecting counter sets below)||CounterDefinitions\system.counters|
|counterNames||Names of individual counters to collect (see Extra counter definitions below)||No default.|
<counterSampling> <definitionFilePaths> <definitionFile path="CounterDefinitions\\system.counters" /> <!-- <definitionFile path="CounterDefinitions\\aspnet.counters" /> --> <!-- <definitionFile path="CounterDefinitions\\dotnet.counters" /> --> <!-- <definitionFile path="CounterDefinitions\\sqlserver.counters" /> --> <!-- <definitionFile path="CounterDefinitions\\webservice.counters" /> --> </definitionFilePaths> <!-- <counterNames> <counter name="\network interface(*)\bytes total/sec" /> </counterNames> --> </counterSampling>
Counter files (
*.counter) define the metrics that PerfCounterReporter will collect. The following counter sets accompany this tool. Enable them by adding entries to
|system.counters||(Enabled by default) Standard Windows counters for CPU, memory and paging, disk IO and NIC.|
|dotnet.counters||The most critical .NET performance counters: exceptions, logical and physical threads, heap bytes, time in GC, committed bytes, pinned objects, etc. System totals are returned, as well as stats for all managed processes, as counters are specified with wildcards.|
|aspnet.counters||Information about requests, errors, sessions, worker processes.|
|sqlserver.counters||The kitchen sink for things that are important to SQL server (including some overlap with system.counters): CPU time for SQL processes, data access performance counters, memory manager, user database size and performance, buffer manager and memory performance, workload (compiles, recompiles), users, locks and latches, and some mention in the comments of red herrings.|
|webservice.counters||Wild card counters for current connections, isapi extension requests, total method requests and bytes.|
Outside of .counter files, counters to collect may also be added directly to
PerfCounterReporter.exe.config as shown below:
<counterNames> <counter name="\network interface(*)\bytes total/sec" /> </counterNames>
Note: Using wildcards in counter names
The names of all counters to be reported are combined together from all the configured files and individually specified names. However, these names have not yet been wildcard-expanded. For instance, if both
\processor(*)\% processor time and
\processor(_total)\% processor time have been specified to be collected,
\processor(_total)\% processor time will be read twice.
NLog is used for logging, and the default configuration of this tool ships with just file logging enabled. The logs are written to
%ALLUSERSPROFILE%\PerfCounterReporter\logs. Generally speaking, on modern Windows installations, this will be
For information on logging see NLog documentation.
This integration is released under the Apache 2.0 license. See LICENSE for more details.