pve_kvm -> pve_kvm_info

This commit is contained in:
illustris
2026-03-13 08:13:09 +05:30
parent 8d9007632a
commit 9c2b1bf384
2 changed files with 3 additions and 3 deletions

View File

@@ -285,7 +285,7 @@ func (c *PVECollector) collectVMMetrics(ch chan<- prometheus.Metric, proc procfs
poolName := vmPoolMap[id]
poolInfo := pools[poolName]
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(c.prefix+"_kvm", "VM info", []string{
prometheus.NewDesc(c.prefix+"_kvm_info", "VM info", []string{
"id", "name", "cpu", "pid", "pool", "pool_levels", "pool1", "pool2", "pool3",
}, nil),
prometheus.GaugeValue, 1,

View File

@@ -250,7 +250,7 @@ func TestCollector_BasicVMMetrics(t *testing.T) {
}
// Check VM info metric
infoMetrics := metrics["pve_kvm"]
infoMetrics := metrics["pve_kvm_info"]
if len(infoMetrics) != 1 {
t.Fatalf("expected 1 kvm info metric, got %d", len(infoMetrics))
}
@@ -409,7 +409,7 @@ func TestCollector_PoolReadError(t *testing.T) {
metrics := collectMetrics(c)
// Should still produce VM info with empty pool
infoMetrics := metrics["pve_kvm"]
infoMetrics := metrics["pve_kvm_info"]
if len(infoMetrics) != 1 {
t.Fatalf("expected 1 kvm info metric, got %d", len(infoMetrics))
}