Note: Datadog no longer maintains or recommends the use of this integration. Instead, use the Windows performance counters integration
in all cases due to its significantly lower overhead and thus better scalability.
Get metrics from your Windows applications and servers with Windows Management Instrumentation (WMI) in real time to
Visualize their performance.
Correlate their activity with the rest of your applications.
If you are only collecting standard metrics from Microsoft Windows and other packaged applications, there are no installation steps. If you need to define new metrics to collect from your application, then you have a few options:
Submit performance counters using System.Diagnostics in .NET, then access them with WMI.
Implement a COM-based WMI provider for your application. You would typically only do this if you are using a non-.NET language.
This feature is available starting with version 5.3 of the agent
Each WMI query has 2 required options, class and metrics and six optional options, host, namespace, filters, provider, tag_by, constant_tags and tag_queries.
class is the name of the WMI class, for example Win32_OperatingSystem or Win32_PerfFormattedData_PerfProc_Process. You can find many of the standard class names on the MSDN docs
. The Win32_FormattedData_* classes provide many useful performance counters by default.
metrics is a list of metrics you want to capture, with each item in the
list being a set of [<WMI_PROPERTY_NAME>, <METRIC_NAME>, <METRIC_TYPE>]:
<WMI_PROPERTY_NAME> is something like NumberOfUsers or ThreadCount. The standard properties are also available on the MSDN docs for each class.
<METRIC_NAME> is the name you want to show up in Datadog.
<METRIC_TYPE> is from the standard choices for all agent checks, such as gauge, rate, histogram or counter.
host is the optional target of the WMI query, localhost is assumed by default. If you set this option, make sure that Remote Management is enabled on the target host. See Configure Remote Management in Server Manager
for more information.
namespace is the optional WMI namespace to connect to (default to cimv2).
filters is a list of filters on the WMI query you may want. For example, for a process-based WMI class you may want metrics for only certain processes running on your machine, so you could add a filter for each process name. You can also use the ‘%’ character as a wildcard.
provider is the optional WMI provider (default to 32 on Datadog Agent 32-bit or 64). It is used to request WMI data from the non-default provider. Available options are: 32 or 64.
for more information.
tag_by optionally lets you tag each metric with a property from the WMI class you’re using. This is only useful when you have multiple values for your WMI query.
tags optionally lets you tag each metric with a set of fixed values.
tag_queries optionally lets you specify a list of queries, to tag metrics with a target class property. Each item in the list is a set of [<LINK_SOURCE_PROPERTY>, <TARGET_CLASS>, <LINK_TARGET_CLASS_PROPERTY>, <TARGET_PROPERTY>] where:
<LINK_SOURCE_PROPERTY> contains the link value
<TARGET_CLASS> is the class to link to
<LINK_TARGET_CLASS_PROPERTY> is the target class property to link to
<TARGET_PROPERTY> contains the value to tag with
It translates to a WMI query:
SELECT '<TARGET_PROPERTY>' FROM '<TARGET_CLASS>' WHERE '<LINK_TARGET_CLASS_PROPERTY>' = '<LINK_SOURCE_PROPERTY>'
The setting [IDProcess, Win32_Process, Handle, CommandLine] tags each process with its command line. Any instance number is removed from tag_by values, for example: name:process#1 => name:process. NB. The Agent must be running under an Administrator account for this to work as the CommandLine property is not accessible to non-admins.