@@ -93,12 +93,12 @@ def __init__(
93
93
# label names and ammount will be needed later to insert labels from custom attributes
94
94
self ._labelNames = {
95
95
'vms' : ['vm_name' , 'host_name' , 'dc_name' , 'cluster_name' ],
96
- 'vm_perf' : ['vm_name' , 'host_name' , 'dc_name' , 'cluster_name' ],
96
+ 'vm_perf' : ['vm_name' , 'host_name' , 'dc_name' , 'cluster_name' , 'unit' ],
97
97
'vmguests' : ['vm_name' , 'host_name' , 'dc_name' , 'cluster_name' ],
98
98
'snapshots' : ['vm_name' , 'host_name' , 'dc_name' , 'cluster_name' ],
99
99
'datastores' : ['ds_name' , 'dc_name' , 'ds_cluster' ],
100
100
'hosts' : ['host_name' , 'dc_name' , 'cluster_name' ],
101
- 'host_perf' : ['host_name' , 'dc_name' , 'cluster_name' ],
101
+ 'host_perf' : ['host_name' , 'dc_name' , 'cluster_name' , 'unit' ],
102
102
}
103
103
104
104
# if tags are gonna be fetched 'tags' will be a label too
@@ -1387,7 +1387,7 @@ def _vmware_get_vm_perf_manager_metrics(self, vm_metrics):
1387
1387
for ent in results :
1388
1388
for metric in ent .value :
1389
1389
vm_metrics [metric_names [metric .id .counterId ]].add_metric (
1390
- labels [ent .entity ._moId ],
1390
+ labels [ent .entity ._moId ] + [ content . perfManager . QueryPerfCounter ([ metric . id . counterId ])[ 0 ]. unitInfo . label ] ,
1391
1391
float (sum (metric .value )),
1392
1392
)
1393
1393
@@ -1472,7 +1472,7 @@ def _vmware_get_host_perf_manager_metrics(self, host_metrics):
1472
1472
for ent in results :
1473
1473
for metric in ent .value :
1474
1474
host_metrics [metric_names [metric .id .counterId ]].add_metric (
1475
- labels [ent .entity ._moId ],
1475
+ labels [ent .entity ._moId ] + [ content . perfManager . QueryPerfCounter ([ metric . id . counterId ])[ 0 ]. unitInfo . label ] ,
1476
1476
float (sum (metric .value )),
1477
1477
)
1478
1478
0 commit comments