pve_kvm -> pve_kvm_info
This commit is contained in:
@@ -285,7 +285,7 @@ func (c *PVECollector) collectVMMetrics(ch chan<- prometheus.Metric, proc procfs
|
|||||||
poolName := vmPoolMap[id]
|
poolName := vmPoolMap[id]
|
||||||
poolInfo := pools[poolName]
|
poolInfo := pools[poolName]
|
||||||
ch <- prometheus.MustNewConstMetric(
|
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",
|
"id", "name", "cpu", "pid", "pool", "pool_levels", "pool1", "pool2", "pool3",
|
||||||
}, nil),
|
}, nil),
|
||||||
prometheus.GaugeValue, 1,
|
prometheus.GaugeValue, 1,
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ func TestCollector_BasicVMMetrics(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check VM info metric
|
// Check VM info metric
|
||||||
infoMetrics := metrics["pve_kvm"]
|
infoMetrics := metrics["pve_kvm_info"]
|
||||||
if len(infoMetrics) != 1 {
|
if len(infoMetrics) != 1 {
|
||||||
t.Fatalf("expected 1 kvm info metric, got %d", len(infoMetrics))
|
t.Fatalf("expected 1 kvm info metric, got %d", len(infoMetrics))
|
||||||
}
|
}
|
||||||
@@ -409,7 +409,7 @@ func TestCollector_PoolReadError(t *testing.T) {
|
|||||||
metrics := collectMetrics(c)
|
metrics := collectMetrics(c)
|
||||||
|
|
||||||
// Should still produce VM info with empty pool
|
// Should still produce VM info with empty pool
|
||||||
infoMetrics := metrics["pve_kvm"]
|
infoMetrics := metrics["pve_kvm_info"]
|
||||||
if len(infoMetrics) != 1 {
|
if len(infoMetrics) != 1 {
|
||||||
t.Fatalf("expected 1 kvm info metric, got %d", len(infoMetrics))
|
t.Fatalf("expected 1 kvm info metric, got %d", len(infoMetrics))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user