Skip to main content

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

warning

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.

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

1. Optional: select a method to restrict access to the load balancer

carefully

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

  1. If you selected a cloud firewall to restrict access to the load balancer, create a firewall and proceed to step 3.

  2. 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_enabled field in the command output:

    openstack network show

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

    2.4. If the port_security_enabled field value is false, filtering is disabled. Create a new private network or public subnet and re-create the load balancer in it.

  3. In the control panel, in the top menu click Products and select Cloud Servers.

  4. Go to the Load Balancers section → Load Balancers tab.

  5. Open the load balancer page.

  6. Click Create Rule.

  7. In the Traffic protocol field, select Prometheus.

  8. Optional: change the load balancer port that Prometheus will query to retrieve metrics. Port 8088 is assigned by default.

  9. If you selected authorized IP addresses — specify the IP address of the cloud server where Prometheus will be installed as the authorized CIDR.

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

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

  1. Connect to the cloud server 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 targets value in the scrape_configs block:

    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 ProductsCloud ServersLoad Balancers → tab Load Balancers → 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 you created earlier.

  2. Install the fontconfig library required for 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 following page in your browser:

    http://<server_ip_address>:3000/login

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

  5. Log in to Grafana. Use the following for your first login:

    • login — admin;
    • password — admin.
  6. Grafana will prompt you to change the password. Enter a new password.

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

  1. Add a data source in 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, enter http://localhost:9090.
  5. Click Save & test.
  6. Add a ready-made dashboard for Octavia metrics. To do this, go to Dashboards+ Import.
  7. In the Import via grafana.com field, enter 15828.
  8. Click Load.
  9. In the Prometheus field, select the Prometheus data source you created in step 5.
  10. Click Import.
  11. Ensure that the dashboard has been created. To do this, go to DashboardsBrowse.
  12. 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.

MetricTypeDescription
octavia_loadbalancer_cpugaugeLoad balancer vCPU usage in percent
octavia_loadbalancer_memorygaugeLoad balancer memory (RAM) usage in percent
octavia_memory_pool_allocated_bytesgaugeTotal memory allocated for memory pools in bytes
octavia_memory_pool_used_bytesgaugeTotal memory used in memory pools in bytes
octavia_memory_pool_failures_totalcounterTotal number of failed memory pool allocation attempts
octavia_loadbalancer_max_connectionsgaugeMaximum number of concurrent 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 concurrent SSL connections
octavia_loadbalancer_current_ssl_connectionsgaugeCurrent number of active SSL connections
octavia_loadbalancer_ssl_connections_totalcounterTotal number of opened SSL connections
octavia_loadbalancer_current_connection_rategaugeCurrent connection rate per second for the last second
octavia_loadbalancer_limit_connection_rategaugeConfigured maximum connection rate per second
octavia_loadbalancer_max_connection_rategaugeMaximum observed connection rate per second
octavia_loadbalancer_current_session_rategaugeCurrent session rate per second for the last second
octavia_loadbalancer_limit_session_rategaugeConfigured maximum session rate per second
octavia_loadbalancer_max_session_rategaugeMaximum observed session rate per second
octavia_loadbalancer_current_ssl_rategaugeCurrent SSL session rate per second for the last second
octavia_loadbalancer_limit_ssl_rategaugeConfigured maximum SSL session rate per second
octavia_loadbalancer_max_ssl_rategaugeMaximum observed SSL session rate per second
octavia_loadbalancer_current_frontend_ssl_key_rategaugeCurrent frontend SSL key decoding time per second for the last second
octavia_loadbalancer_max_frontend_ssl_key_rategaugeMaximum observed frontend SSL key decoding time per second
octavia_loadbalancer_current_backend_ssl_key_rategaugeCurrent backend SSL key decoding time per second for the last second
octavia_loadbalancer_max_backend_ssl_key_rategaugeMaximum observed backend SSL key decoding time per second
octavia_loadbalancer_ssl_cache_lookups_totalcounterTotal number of SSL session cache lookups
octavia_loadbalancer_ssl_cache_misses_totalcounterTotal number of SSL session cache misses
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 level of input data compression in bytes
octavia_loadbalancer_listenersgaugeNumber of active rules
octavia_loadbalancer_dropped_logs_totalcounterTotal number of logs dropped