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
+1 -1
View File
@@ -202,7 +202,7 @@ func (c *Collector) Build(logger *slog.Logger, miSession *mi.Session) error {
nil,
)
c.cpuTimeTotal = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "cpu_time_total"),
prometheus.BuildFQName(types.Namespace, Name, "cpu_time_seconds_total"),
"Returns elapsed time that all of the threads of this process used the processor to execute instructions by mode (privileged, user).",
[]string{"process", "process_id", "mode"},
nil,
+1 -1
View File
@@ -68,7 +68,7 @@ func TestCollectorCurrentProcess(t *testing.T) {
require.Positive(t, testutils.MetricValuesByLabel(families, name, "process_id")[pid], name)
}
cpu := families["windows_process_cpu_time_total"].GetMetric()
cpu := families["windows_process_cpu_time_seconds_total"].GetMetric()
require.Len(t, cpu, 2)
require.NotNil(t, cpu[0].GetCounter())
}