registry: add a multiplier option to convert values to base units (#2774)

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jan-Otto Kröpke
2026-10-16 21:32:00 +02:00
committed by GitHub
co-authored by Claude
parent 4f8fc2baef
commit 5b22eca06a
7 changed files with 209 additions and 6 deletions
+14
View File
@@ -56,6 +56,7 @@ YAML:
metric: windows_registry_windows_major_version # optional
help: Windows major version number # optional
type: gauge # optional
multiplier: 1 # optional
labels: # optional
product: windows
- name: memory_management # required
@@ -77,6 +78,7 @@ JSON:
"metric": "windows_registry_windows_major_version",
"help": "Windows major version number",
"type": "gauge",
"multiplier": 1,
"labels": { "product": "windows" }
}
]
@@ -157,6 +159,18 @@ in the registry.
This key is optional.
##### multiplier
A factor that the value is multiplied by before it is exported, to convert it to
the base unit the Prometheus [naming conventions](https://prometheus.io/docs/practices/naming/#base-units)
ask for. For example, `0.001` converts milliseconds to seconds, `0.01` percent to
a ratio and `3600` hours to seconds. It must be a positive number, so counters
keep counting up. If the multiplier is the reciprocal of an integer, like `0.001`,
the value is divided by that integer instead, which avoids rounding artifacts
such as `0.009000000000000001`. If not specified, the value is exported as is.
This key is optional.
##### labels
Labels is a map of key-value pairs that will be added as constant labels to the