[comment]: # ({3f27ca92-fb204a33})
# 10 Discovery of Windows performance counter instances

[comment]: # ({/3f27ca92-fb204a33})

[comment]: # ({b3792a56-f150cb4f})
#### Overview

It is possible to discover object instances of Windows performance counters.
This is useful for multi-instance performance counters.

[comment]: # ({/b3792a56-f150cb4f})

[comment]: # ({4c362d04-b89c3c17})
#### Item key

To configure the [discovery rule](/manual/discovery/low_level_discovery#discovery_rule), use the following item:

-   `perf_instance.discovery[object]`

Note that the object name may be localized. For example:

```bash
perf_instance.discovery[Processor] # The object name is in English.
perf_instance.discovery[Processador] # The object name is in Portuguese.
```

Alternatively, to ensure that the object name is provided in English, independent of OS localization, use the following item:

-   `perf_instance_en.discovery[object]`

For example:

```bash
perf_instance_en.discovery[Processor]
perf_instance_en.discovery[Memory]
```

[comment]: # ({/4c362d04-b89c3c17})

[comment]: # ({12c54373-4407d98a})
#### Supported macros

The discovery process will return all instances of the specified object in the `{#INSTANCE}` macro:

```json
[
    {"{#INSTANCE}":"0"},
    {"{#INSTANCE}":"1"},
    {"{#INSTANCE}":"_Total"}
]
```

This macro may be used in the prototypes of `perf_counter[]` and `perf_counter_en[]` items.

For example, if the item key used in the discovery rule is `perf_instance.discovery[Processor]`, you may create the following item prototype:

```bash
perf_counter["\Processor({#INSTANCE})\% Processor Time"]
```

Note:

-   If the specified object is not found or does not support variable instances, the discovery item will become NOTSUPPORTED.
-   If the specified object supports variable instances but currently does not have any instances, an empty JSON array will be returned.
-   Duplicate instances will be skipped.

[comment]: # ({/12c54373-4407d98a})
