Load Balancer Monitoring
For cloud load balancers, you can set up monitoring — collect and export OpenStack Octavia metrics in Prometheus format and connect Grafana to track metrics on dashboards.
You can view the list of available metrics in the Octavia metrics in Prometheus format table.
Set up monitoring
We do not recommend setting up monitoring during periods of maximum infrastructure load. As traffic on the load balancer increases, the frequency of metric requests rises, which affects the performance of load balancer instances.
- Optional: select a method to restrict access to the load balancer.
- Create a load balancer rule.
- Create a cloud server for Prometheus and Grafana.
- Install Prometheus on the cloud server and configure metric collection.
- Install Grafana on the cloud server and log in to Grafana.
- Create a dashboard in Grafana.
1. Optional: select a method to restrict access to the load balancer
Load balancer metrics will be accessible from the internet via an IP address and port without authentication if:
- the load balancer is in a private network and has a public IP address connected;
- or the load balancer is in a public subnet.
You can restrict access to the load balancer from the internet. The available restriction method depends on how the load balancer is connected to the internet.
For a load balancer with a public IP address and for a load balancer in a public subnet, you can specify authorized IP addresses from which the load balancer will accept traffic when creating a load balancer rule. Traffic filtering (port security) must be enabled in the load balancer network.
For a load balancer with a public IP address, you can also restrict access via a cloud firewall.
2. Create a load balancer rule
Control Panel
OpenStack CLI
-
If you selected a cloud firewall to restrict access to the load balancer, create a firewall and proceed to step 3.
-
If you selected specifying authorized IP addresses in a load balancer rule to restrict access — ensure that traffic filtering (port security) is enabled in the load balancer network.
2.1. Open OpenStack CLI.
2.2. View the network traffic filtering status — the
port_security_enabledfield in the command output:openstack network show2.3. If the
port_security_enabledfield value istrue— filtering is enabled. Proceed to step 3.2.4. If the
port_security_enabledfield value isfalse, filtering is disabled. Create a new private network or public subnet and re-create the load balancer in it. -
In the control panel, in the top menu click Products and select Cloud Servers.
-
Go to the Load Balancers section → Load Balancers tab.
-
Open the load balancer page.
-
Click Create Rule.
-
In the Traffic protocol field, select Prometheus.
-
Optional: change the load balancer port that Prometheus will query to retrieve metrics. Port 8088 is assigned by default.
-
If you selected authorized IP addresses — specify the IP address of the cloud server where Prometheus will be installed as the authorized CIDR.
-
Optional: change the connection settings for incoming requests to the load balancer. To do this, open the Advanced rule settings block and specify the connection timeout and maximum connections.
-
Click Create.
2. Create a cloud server for Prometheus and Grafana
Prometheus and Grafana must be installed and configured on a cloud server located in the same private subnet as the load balancer.
Use the Create a cloud server guide.
Select:
- source — any ready-made Ubuntu image, for example
Ubuntu 22.04 LTS 64-bit; - configuration — any configuration (fixed or custom) with vCPU from 2, RAM from 4 GB and boot disk size from 10 GB;
- network — the private subnet with a public IP address to which the load balancer is connected.
3. Install Prometheus on the cloud server and configure metric collection
-
Connect to the cloud server you created earlier.
-
Download and install Prometheus:
sudo apt updatewget https://github.com/prometheus/prometheus/releases/download/v2.45.1/prometheus-2.45.1.linux-amd64.tar.gztar xvf prometheus-2.45.1.linux-amd64.tar.gzcd prometheus-2.45.1.linux-amd64 -
Open the
prometheus.ymlconfiguration file:nano prometheus.yml -
Change the
targetsvalue in thescrape_configsblock:Example block:
scrape_configs:- job_name: "prometheus"static_configs:- targets: ["<loadbalancer_private_ip_address>:8088"]Specify
<loadbalancer_private_ip_address>— private IP address of the load balancer. You can view it in the control panel: in the top menu click Products → Cloud Servers → Load Balancers → tab Load Balancers → load balancer page. -
Run Prometheus locally:
sudo apt install screenscreen -dm ./prometheus --config.file=./prometheus.yml --web.listen-address=localhost:9090
4. Install Grafana on the cloud server and log in to Grafana
-
Connect to the cloud server you created earlier.
-
Install the fontconfig library required for Grafana:
sudo apt install -y libfontconfig1 -
Download and install Grafana:
cd ~wget https://dl.grafana.com/oss/release/grafana_9.1.0_amd64.debsudo dpkg -i grafana_9.1.0_amd64.deb -
Open the following page in your browser:
http://<server_ip_address>:3000/loginSpecify
<server_ip_address>— public IP address of the cloud server. You can copy it in the control panel: in the top menu, click Products → Cloud Servers → server page → tab Ports → in the port card, click next to the public IP address. -
Log in to Grafana. Use the following for your first login:
- login —
admin; - password —
admin.
- login —
-
Grafana will prompt you to change the password. Enter a new password.
-
Click Submit.
5. Create a dashboard in Grafana
A pre-configured dashboard is available for collecting Octavia metrics. For more information, see the OpenStack Octavia Amphora Load Balancer page on the official Grafana website.
- Add a data source in Grafana. To do this, go to Configuration → Data sources.
- Click Add data source.
- Select the Prometheus data source type.
- In the URL field, enter
http://localhost:9090. - Click Save & test.
- Add a ready-made dashboard for Octavia metrics. To do this, go to Dashboards → + Import.
- In the Import via grafana.com field, enter
15828. - Click Load.
- In the Prometheus field, select the Prometheus data source you created in step 5.
- Click Import.
- Ensure that the dashboard has been created. To do this, go to Dashboards → Browse.
- Open the OpenStack Octavia Amphora Load Balancer dashboard.
Octavia metrics in Prometheus format
Metrics are collected for all load balancer components:
octavia_loadbalancer,octavia_memory_pool— load balancer metrics;octavia_listener— rule metrics. These are collected for each rule individually and are distinguished by ID;octavia_pool— target group metrics. These are collected for each target group individually and are distinguished by ID;octavia_member— server metrics. These are collected for each server individually and are distinguished by ID.
For more information on load balancer components and the OpenStack Octavia model, see the How the load balancer works subsection.
Load balancer metrics
Rule metrics
Target group metrics
Server metrics