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;
- internet — access type with a public floating IP address;
- private network — a private subnet to which a load balancer is connected.
3. Install Prometheus on a cloud server and configure metric collection
-
Connect to the cloud server that 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 configuration file
prometheus.yml:nano prometheus.yml -
Change the
targetsvalue in thescrape_configs:block:Example block:
scrape_configs:- job_name: "prometheus"static_configs:- targets: ["<loadbalancer_private_ip_address>:8088"]Specify
<loadbalancer_private_ip_address>— the 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 → Load balancers tab → load balancer page. -
Start Prometheus locally:
sudo apt install screenscreen -dm ./prometheus --config.file=./prometheus.yml --web.listen-address=localhost:9090
4. Install Grafana on a cloud server and log in to Grafana
-
Connect to the cloud server that you created earlier.
-
Install the fontconfig library, which is required to use 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>— the public IP address of the cloud server. You can copy it in the control panel: from the top menu, click Products → Cloud Servers → server page → Ports tab → in the port card, click next to the public IP address. -
Log in to Grafana. Use the following credentials for your first login:
- login —
admin; - password —
admin.
- login —
-
Grafana will prompt you to change your password. Enter a new password.
-
Click Submit.
5. Create a dashboard in Grafana
There is a ready-made dashboard for collecting Octavia metrics. Read more on the OpenStack Octavia Amphora Load Balancer page on the official Grafana website.
- Add a Data Source (Data Source) in Grafana. To do this, go to the Configuration → Data sources.
- Click Add data source.
- Select the data source type Prometheus.
- In the URL field, enter
http://localhost:9090. - Click Save & test.
- Add the 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 that you created in step 5.
- Click Import.
- Make sure the dashboard has been created. To do this, go to Dashboards → Browse.
- Open the OpenStack Octavia Amphora Load Balancer dashboard page.
Octavia metrics in Prometheus format
Metrics are collected for all load balancer components:
octavia_loadbalancer,octavia_memory_pool— load balancer metrics;octavia_listener— listener metrics. Collected for each listener individually, distinguished by ID;octavia_pool— pool metrics. Collected for each pool individually, distinguished by ID;octavia_member— member metrics. Collected for each member individually, distinguished by ID.
Read more about load balancer components and the OpenStack Octavia model in the How Load Balancers Work subsection.
Load balancer metrics
Rule metrics
Target group metrics
Server metrics