Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 83c418e

Browse files
committed
Add revised description for _Total instance and example usage
1 parent 426abe4 commit 83c418e

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

gdi/opentelemetry/components/windowsperfcounters-receiver.rst

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ The following example shows how to scrape performance counters using different c
285285
Instances configuration
286286
---------------------------------
287287

288-
An instance is any entity that produces performance data. Instances can have one or more counter values.
288+
An instance is any entity that produces performance data. Instances can have 1 or more counter values.
289289

290290
The receiver supports the following values through the ``instances`` field:
291291

@@ -299,14 +299,44 @@ The receiver supports the following values through the ``instances`` field:
299299
* - ``"*"``
300300
- All instances
301301
* - ``"_Total"``
302-
- The total instance
302+
- The aggregate of all other instance values, which is itself an instance. For more information, see :ref:`total-instance-behavior`.
303303
* - ``"instance1"``
304304
- Single instance
305305
* - ``["instance1", "instance2", ...]``
306306
- Set of instances
307307
* - ``["_Total", "instance1", "instance2", ...]``
308308
- Set of instances including the total instance
309309

310+
.. _total-instance-behavior:
311+
312+
_Total instance behavior and the aggregation counter
313+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
314+
315+
To avoid dropping the ``_Total`` instance, you must configure the receiver to collect it individually on its own metric.
316+
317+
For example:
318+
319+
.. code-block:: yaml
320+
321+
windowsperfcounters:
322+
metrics:
323+
processor.time.total:
324+
description: Total CPU active and idle time
325+
unit: "%"
326+
gauge:
327+
collection_interval: 30s
328+
perfcounters:
329+
- object: "Processor"
330+
instances:
331+
- "_Total"
332+
counters:
333+
- name: "% Processor Time"
334+
metric: processor.time.total
335+
336+
.. warning::
337+
338+
When using an ``instance`` value of ``"*"``, if the counter uses a value other than ``_Total``, make sure to avoid double counting when aggregating metrics after the receiver scrapes them.
339+
310340
Known limitations
311341
---------------------------------
312342

0 commit comments

Comments
 (0)