diff --git a/docs/metrics.md b/docs/metrics.md index e06fcbe..337396b 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -289,16 +289,16 @@ kos_firewall_v2_group_status{description="",egressPolicyID="cbb204f5-3a92-427f-b kos_firewall_v2_group_status{description="",egressPolicyID="cbb204f5-3a92-427f-b082-c34a004856df",id="f4d10c07-4b29-4b91-a57c-7a4762634f90",ingressPolicyID="ca06e59e-5d49-4944-80a6-f14e01edc01c",name="my-firewall",projectID="1b08db53fdec4c498a15ad7d027eac4f",status="PENDING_CREATE"} 0 kos_firewall_v2_group_status{description="",egressPolicyID="cbb204f5-3a92-427f-b082-c34a004856df",id="f4d10c07-4b29-4b91-a57c-7a4762634f90",ingressPolicyID="ca06e59e-5d49-4944-80a6-f14e01edc01c",name="my-firewall",projectID="1b08db53fdec4c498a15ad7d027eac4f",status="PENDING_DELETE"} 0 kos_firewall_v2_group_status{description="",egressPolicyID="cbb204f5-3a92-427f-b082-c34a004856df",id="f4d10c07-4b29-4b91-a57c-7a4762634f90",ingressPolicyID="ca06e59e-5d49-4944-80a6-f14e01edc01c",name="my-firewall",projectID="1b08db53fdec4c498a15ad7d027eac4f",status="PENDING_UPDATE"} 0 -kos_loadbalancer_admin_state_up{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",vip_address="10.6.0.8"} 1 -kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="ACTIVE",vip_address="10.6.0.8"} 1 -kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="ALLOCATED",vip_address="10.6.0.8"} 0 -kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="BOOTING",vip_address="10.6.0.8"} 0 -kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="DELETED",vip_address="10.6.0.8"} 0 -kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="ERROR",vip_address="10.6.0.8"} 0 -kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="PENDING_CREATE",vip_address="10.6.0.8"} 0 -kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="PENDING_DELETE",vip_address="10.6.0.8"} 0 -kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="PENDING_UPDATE",vip_address="10.6.0.8"} 0 -kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="READY",vip_address="10.6.0.8"} 0 +kos_loadbalancer_admin_state_up{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",vip_address="10.6.0.8"} 1 +kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="ACTIVE",vip_address="10.6.0.8"} 1 +kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="ALLOCATED",vip_address="10.6.0.8"} 0 +kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="BOOTING",vip_address="10.6.0.8"} 0 +kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="DELETED",vip_address="10.6.0.8"} 0 +kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="ERROR",vip_address="10.6.0.8"} 0 +kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="PENDING_CREATE",vip_address="10.6.0.8"} 0 +kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="PENDING_DELETE",vip_address="10.6.0.8"} 0 +kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="PENDING_UPDATE",vip_address="10.6.0.8"} 0 +kos_loadbalancer_provisioning_status{id="059e7a29-5229-409e-870d-6ceb9c1059a9",name="foo",port_id="10902a71-299d-4666-b086-1a0725288dac",provider="vmwareedge",provisioning_status="READY",vip_address="10.6.0.8"} 0 kos_neutron_floating_ip_status{fixed_ip="",floating_ip="172.17.0.161",id="aa8ae8f5-fd6e-49fc-a755-93cccc74ae11",port_id=""} 1 kos_neutron_floating_ip_status{fixed_ip="",floating_ip="172.17.0.174",id="ed22b15f-05fd-401d-8bb1-9745c7b8e93d",port_id=""} 1 kos_neutron_floating_ip_status{fixed_ip="10.6.0.8",floating_ip="172.17.0.173",id="81a46647-ff4e-4697-9162-f802a15e88a5",port_id="10902a71-299d-4666-b086-1a0725288dac"} 1 diff --git a/pkg/metrics/loadbalancer.go b/pkg/metrics/loadbalancer.go index 799c95f..0af2794 100644 --- a/pkg/metrics/loadbalancer.go +++ b/pkg/metrics/loadbalancer.go @@ -16,7 +16,7 @@ var ( // possible load balancer provisioning states, from https://github.com/openstack/octavia-lib/blob/fe022cdf14604206af783c8a0887c008c48fd053/octavia_lib/common/constants.py#L169 provisioningStates = []string{"ALLOCATED", "BOOTING", "READY", "ACTIVE", "PENDING_DELETE", "PENDING_UPDATE", "PENDING_CREATE", "DELETED", "ERROR"} - loadBalancerLabels = []string{"id", "vip_address", "provider", "port_id"} + loadBalancerLabels = []string{"id", "name", "vip_address", "provider", "port_id"} ) func registerLoadBalancerMetrics() { @@ -71,7 +71,7 @@ func PublishLoadBalancerMetrics(client *gophercloud.ServiceClient, tenantID stri // publishLoadBalancerMetric extracts data from a load balancer and exposes the metrics via prometheus func publishLoadBalancerMetric(lb loadbalancers.LoadBalancer) { - labels := []string{lb.ID, lb.VipAddress, lb.Provider, lb.VipPortID} + labels := []string{lb.ID, lb.Name, lb.VipAddress, lb.Provider, lb.VipPortID} loadbalancerAdminStateUp.WithLabelValues(labels...).Set(boolFloat64(lb.AdminStateUp))