@@ -167,20 +167,20 @@ def get_host_details(compute_client, placement_client):
167167 free_by_flavor_total = prom_core .GaugeMetricFamily (
168168 "openstack_free_capacity_by_flavor_total" ,
169169 "Free capacity if you fill the cloud full of each flavor" ,
170- labels = ["flavor_name" ],
170+ labels = ["flavor_name" , "public" ],
171171 )
172- flavor_names = sorted ([ f . name for f in flavors ])
173- for flavor_name in flavor_names :
174- counts = capacity_per_flavor .get (flavor_name , {}).values ()
172+
173+ for f in flavors :
174+ counts = capacity_per_flavor .get (f . name , {}).values ()
175175 total = 0 if not counts else sum (counts )
176- free_by_flavor_total .add_metric ([flavor_name ], total )
176+ free_by_flavor_total .add_metric ([f . name , f . is_public ], total )
177177 # print(f'openstack_free_capacity_by_flavor{{flavor="{flavor_name}"}} {total}')
178178
179179 # capacity per host
180180 free_by_flavor_hypervisor = prom_core .GaugeMetricFamily (
181181 "openstack_free_capacity_hypervisor_by_flavor" ,
182182 "Free capacity for each hypervisor if you fill remaining space full of each flavor" ,
183- labels = ["hypervisor" , "flavor_name" , "az_aggregate" , "project_aggregate" ],
183+ labels = ["hypervisor" , "flavor_name" , "az_aggregate" , "project_aggregate" , "public" ],
184184 )
185185 resource_providers , project_to_aggregate = get_resource_provider_info (
186186 compute_client , placement_client
0 commit comments