Skip to main content
Load balancer monitoring
Last update:

Load balancer monitoring

For cloud load balancers, you can customize monitoring — collect and export OpenStack Octavia metrics in Prometheus format and connect Grafana to track metrics on dashboards.

To see a list of available metrics, see the Octavia Metrics table in Prometheus.

Set up monitoring

carefully

We do not recommend configuring monitoring during the peak load period of your infrastructure. When traffic on the load balancer increases, the frequency of metrics requests increases — this affects the performance of the load balancer instances.

  1. Optional: Select a method to restrict access to the balancer.
  2. Create a load balancer rule.
  3. Create a cloud server for Prometheus and Grafana.
  4. Install Prometheus on a cloud server and set up metrics collection.
  5. Install Grafana on the cloud server and log in to Grafana.
  6. Create a dashboard in Grafana.

1. Optional: choose how to restrict access to the balancer

carefully

Balancer metrics will be accessible from the Internet by IP address and port without authentication if:

  • The balancer is on a private network and has a public IP address connected to it;
  • or the balancer is on a public subnet.

You can restrict access to the balancer from the Internet. The available method of restricting access depends on how the balancer is connected to the Internet.

For a load balancer with a public IP address and for a load balancer on a public subnet, you can specify the allowed IP addresses from which the load balancer will accept traffic when creating a load balancer rule. The load balancer network must have port security enabled.

For a balancer with a public IP address, you can also restrict access through a cloud firewall.

2. Create a load balancer rule

  1. If you chose a cloud firewall to restrict access to the balancer, create a firewall and go to step 3.

  2. If you chose to specify allowed IP addresses in a balancer rule to restrict access to the balancer, make sure that port security is enabled on the balancer network.

    2.1 Open the OpenStack CLI.

    2.2 Check the network traffic filtering status — port_security_enabled field in the command output:

    openstack network show

    2.3 If the port_security_enabled field is true — filtering is enabled. Go to step 3.

    2.4 If the port_security_enabled field is false, filtering is disabled. Enable filtering and go to step 3.

  3. In the dashboard, on the top menu, click Products and select Cloud Servers.

  4. Go to BalancersBalancers tab.

  5. Open the balancer page.

  6. Click Create Rule.

  7. In the Traffic reception protocol field, select the Prometheus option.

  8. Optional: change the balancer port that Prometheus will access to receive metrics. The default port is 8088.

  9. If you have selected allowed IP addresses to restrict access to the balancer — specify the IP address of the cloud server where Prometheus will be installed as the allowed CIDR.

  10. Optional: change the connection settings for incoming requests to the balancer, to do this open the Advanced Rule Settings block and specify the connection timeout and maximum connections.

  11. Click Create.

2. Create a cloud server for Prometheus and Grafana

Prometheus and Grafana need to be installed and configured on a cloud server that is on the same private subnet as the load balancer.

Use the instructions to Create a cloud server.

Select:

  • source — any ready-made Ubuntu image, for example Ubuntu 22.04 LTS 64-bit;
  • configuration — any configuration (fixed or arbitrary) with vCPU from 2, RAM from 4 GB and boot disk size from 10 GB;
  • network — a private subnet with a public IP address to which the load balancer is connected.

3. Install Prometheus on a cloud server and configure metrics collection

  1. Connect to the cloud server that you created you created earlier.

  2. Download and install Prometheus:

    sudo apt update
    wget https://github.com/prometheus/prometheus/releases/download/v2.45.1/prometheus-2.45.1.linux-amd64.tar.gz
    tar xvf prometheus-2.45.1.linux-amd64.tar.gz
    cd prometheus-2.45.1.linux-amd64
  3. Open the prometheus.yml configuration file:

    nano prometheus.yml
  4. Change the value of targets in the scrape_configs block:

    Block example:

    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 ProductsCloud ServersBalancersBalancers tab → Load Balancer page.

  5. Run Prometheus locally:

    sudo apt install screen
    screen -dm ./prometheus --config.file=./prometheus.yml --web.listen-address=localhost:9090

4. Install Grafana on the cloud server and log in to Grafana

  1. Connect to the cloud server that you created you created earlier.

  2. Install the fontconfig library, which is required to work with Grafana:

    sudo apt install -y libfontconfig1
  3. Download and install Grafana:

    cd ~
    wget https://dl.grafana.com/oss/release/grafana_9.1.0_amd64.deb
    sudo dpkg -i grafana_9.1.0_amd64.deb
  4. Open the page in your browser:

    http://<server_ip_address>:3000/login

    Specify <server_ip_address> — the public IP address of the cloud server. You can copy in the control panel in the top menu click ProductsCloud Servers → Server page → Ports tab → in the port card click next to the public IP address.

  5. Authorize Grafana. For the first authorization, use:

    • admin;
    • password is admin.
  6. Grafana will prompt you to change your password. Enter the new password.

  7. 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.

  1. Add a Data Source to Grafana. To do this, go to ConfigurationData sources.
  2. Click Add data source.
  3. Select the Prometheus data source type.
  4. In the URL field, type http://localhost:9090.
  5. Click Save & test.
  6. Add a ready-made dashboard for Octavia metrics. To do this, go to Control panels+ Import.
  7. In the Import via grafana.com field, enter 15828.
  8. Press Load.
  9. In the Prometheus field, select the Prometheus data source you created in step 5.
  10. Click Import.
  11. Make sure that the dashboard has been created. To do this, go to Control panelsBrowse.
  12. 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 — rule metrics. Collected for each rule separately, differentiated by ID;
  • octavia_pool — metrics of the target group. Collected for each target group separately, differentiated by ID;
  • octavia_member — server metrics. Collected for each server separately, differentiated by ID.

Learn more about the balancer components and the OpenStack Octavia model in the How the balancer works subsection.

MetricTypeDescription
octavia_loadbalancer_cpugaugePercentage vCPU load balancer vCPU utilization
octavia_loadbalancer_memorygaugeLoad balancer memory (RAM) utilization in percentage
octavia_memory_pool_allocated_bytesgaugeTotal amount of memory allocated to memory pools in bytes
octavia_memory_pool_used_bytesgaugeTotal amount of memory used in memory pools in bytes
octavia_memory_pool_failures_totalcounterTotal number of unsuccessful attempts to allocate the memory pool
octavia_loadbalancer_max_connectionsgaugeMaximum number of simultaneous connections
octavia_loadbalancer_current_connectionsgaugeNumber of active sessions
octavia_loadbalancer_connections_totalcounterTotal number of sessions created
octavia_loadbalancer_requests_totalcounterTotal number of TCP and HTTP requests
octavia_loadbalancer_max_ssl_connectionsgaugeConfigured maximum number of simultaneous SSL connections
octavia_loadbalancer_current_ssl_connectionsgaugeCurrent number of active SSL connections
octavia_loadbalancer_ssl_connections_totalcounterTotal number of open SSL connections
octavia_loadbalancer_current_connection_rategaugeCurrent number of connections per second for the last second
octavia_loadbalancer_limit_connection_rategaugeConfigured maximum number of connections per second
octavia_loadbalancer_max_connection_rategaugeMaximum observed number of connections per second
octavia_loadbalancer_current_session_rategaugeCurrent number of sessions per second for the last second
octavia_loadbalancer_limit_session_rategaugeCustomized maximum number of sessions per second
octavia_loadbalancer_max_session_rategaugeMaximum observed number of sessions per second
octavia_loadbalancer_current_ssl_rategaugeCurrent number of SSL sessions per second for the last second
octavia_loadbalancer_limit_ssl_rategaugeConfigured maximum number of SSL sessions per second
octavia_loadbalancer_max_ssl_rategaugeMaximum observed number of SSL sessions per second
octavia_loadbalancer_current_frontend_ssl_key_rategaugeCurrent SSL key decoding time on the frontend per second for the last second
octavia_loadbalancer_max_frontend_ssl_key_rategaugeMaximum observed SSL key decoding time on the frontend per second
octavia_loadbalancer_current_backend_ssl_key_rategaugeCurrent SSL key decoding time on the backend in seconds for the last second
octavia_loadbalancer_max_backend_ssl_key_rategaugeMaximum observed SSL key decoding time on the backend per second
octavia_loadbalancer_ssl_cache_lookups_totalcounterTotal number of searches in the SSL session cache
octavia_loadbalancer_ssl_cache_misses_totalcounterTotal number of SSL session cache losses
octavia_loadbalancer_http_comp_bytes_in_totalcounterNumber of bytes per second before HTTP compression for the last second
octavia_loadbalancer_http_comp_bytes_out_totalcounterNumber of bytes per second after HTTP compression for the last second
octavia_loadbalancer_limit_http_compgaugeConfigured maximum input data compression ratio in bytes
octavia_loadbalancer_listenersgaugeNumber of active rules
octavia_loadbalancer_dropped_logs_totalcounterTotal number of deleted logs