discovery(openstack): add load balancer discovery
Description
OpenStack Octavia natively supports enabling the Prometheus endpoint on some drivers, like amphora. For that, users need to create a listener with the PROMETHEUS protocol, and the metrics from the load balancer can be scraped automatically.
Adding the loadbalancer role support for the openstack discovery will enhance the ability to dynamically scrape the load balancer metrics without using other manual options.
The code lists all Load Balancers and Listeners from the NewLoadBalancerV2 client and lists all Floating IPs from the NewNetworkV2 client.
References
- https://docs.openstack.org/octavia/latest/user/guides/monitoring.html
It will not need to be reviewed until #14367 is merged since a rebase will be required.
@machine424 @jan--f is this in your comfort zone maybe?
@jan--f is this in your comfort zone maybe?
Not for me but I' can try to find someone.
I pinged a few people, asking for feedback. Due to the end of the year, this may take some time.
This is really great work! I tested out #14367 and this PR together in openstack on openshift environment and I do see octavia metrics
Also, visualized these metrics by importing https://grafana.com/grafana/dashboards/15828-openstack-octavia-amphora-load-balancer/
It would be nice to have operating_status as well in the metrics since DEGRADED operating status of LBs could be concerning.
This is really great work! I tested out #14367 and this PR together in openstack on openshift environment and I do see octavia metrics
Also, visualized these metrics by importing https://grafana.com/grafana/dashboards/15828-openstack-octavia-amphora-load-balancer/
It would be nice to have
operating_statusas well in the metrics sinceDEGRADEDoperating status of LBs could be concerning.
Hi @yadneshk,
Many thanks for the feedback.
I agree that the operating_status can be added to target labels for use if needed. I will work on the addition as well as rename loadbalancer_status to loadbalancer_provisioning_status to be clear between both status labels.
This is really great work! I tested out #14367 and this PR together in openstack on openshift environment and I do see octavia metrics
Also, visualized these metrics by importing https://grafana.com/grafana/dashboards/15828-openstack-octavia-amphora-load-balancer/ It would be nice to have
operating_statusas well in the metrics sinceDEGRADEDoperating status of LBs could be concerning.Hi @yadneshk,
Many thanks for the feedback.
I agree that the
operating_statuscan be added to target labels for use if needed. I will work on the addition as well as renameloadbalancer_statustoloadbalancer_provisioning_statusto be clear between both status labels.
@yadneshk added on commit https://github.com/prometheus/prometheus/pull/15539/commits/cb7254158b335e9c7110d7a05bbf2dd2b21b98fb
Feel free to re-test it if you can 🙏
@paulojmdias operating and provisioning status look good now
@yadneshk thanks for reviewing this.
@machine424 @jan--f does this look good to you to get merged?
@beorn7 I think this change here looks good but #14367 needs to be approved and merged before this can go in.
Since PR #14367 was merged, I rebased this code to include the incoming changes.
@machine424 @jan--f you can review when you can. 🙌
This review should be aligned with #15558, the PR will be merged first, and then the other one will need a rebase.
