collector: publish base units and _total counter names (#2743)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2026-10-16 10:48:26 +02:00
committed by GitHub
parent dc8092f46d
commit 3fb18521f6
131 changed files with 1674 additions and 1459 deletions
+8 -1
View File
@@ -107,7 +107,14 @@ exercised a live Windows role.
- Preserve metric names, label sets, types, units, defaults and configuration
compatibility unless the change intentionally updates that contract. Update
the corresponding collector documentation and affected queries together.
Follow existing deprecation patterns when replacing published metrics.
Replace published metrics with a hard rename: do not keep deprecated copies
or aliases, and list the change in `UPGRADE.md`.
- Name metrics after the Prometheus conventions: publish base units (seconds,
bytes, hertz, ratios from 0 to 1) and put the unit in the name (`_seconds`,
`_bytes`, `_hertz`, `_ratio`), never `_mhz`, `_percent`, `_minutes`,
`_milliseconds`, `_microseconds`, `_kb` or an `_in_<unit>` infix. Convert
Windows values explicitly (MHz, percent, KiB, ms). Counters end in `_total`;
gauges never do. List renamed metrics in `UPGRADE.md`.
- Determine metric types per counter, using `pdh.Collector.MetricType` where
appropriate. Raw PDH values can be cumulative numerators, ticks or counts,
even when the Windows counter name says average, percentage or seconds.