Skip to main content

Windowsperfcounters Receiver

Status Available in: contrib Maintainers: @dashpole, @alxbl, @pjanotti Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

This receiver is based on the Telegraf Windows Performance Counters Input Plugin. If one of the specified performance counters cannot be loaded on startup, a warning will be printed, but the application will not fail fast. It is expected that some performance counters may not exist on some systems due to different OS configuration.

Configuration

The collection interval and the list of performance counters to be scraped can be configured:

Understanding the instances configuration option

Aggregation instances

By default, the receiver treats _Total as the aggregation instance. When a query returns _Total with other instances, _Total is omitted because it can be derived in the backend. When _Total is collected by itself, its instance attribute is omitted. Set aggregation_name to change which instance receives this treatment. For example, aggregation_name: "_Global_" omits _Global_ instead of _Total. To retain the aggregation instance alongside the wildcard results, explicitly include its name in instances. This still creates one wildcard query:
For a counter whose aggregation instance has a different name, configure that name consistently in both fields. For example:
[!WARNING] Retaining an aggregation instance alongside its component instances can cause double-counting. Prefer deriving aggregate values in the backend when possible.

Recreating the query on every scrape

On some versions of Windows, Counters are sometimes corrupted and continuously return invalid data after the first scrape. When/If this happens, it is possible to set the counter setting recreate_query to true (defaults to false) to tell the receiver to recreate the PDH query on every scrape. This has slight performance implications but should be inconsequential unless collection_interval is very aggressive. If re-creating the query fails, the previous query will be re-used and an error will be logged.

Scraping at different frequencies

If you would like to scrape some counters at a different frequency than others, you can configure multiple windows_perf_counters receivers with different collection_interval values. For example:

Defining metric format

To report metrics in the desired output format, define a metric and reference it in the corresponding counter, along with any applicable attributes. The metric’s data type can either be gauge (default) or sum.

Sum Config

Gauge Config

A gauge config currently accepts no settings. It is specified as an object for forwards compatibility. e.g. To output the Memory/Committed Bytes counter as a metric with the name bytes.committed:

Known Limitation

Configuration

Example Configuration


Last generated: 2026-08-24