Skip to main content
Cloud load balancer monitoring
Last update:

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

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

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. Create a load balancer rule.
  2. Create a cloud server for Prometheus and Grafana.
  3. Install Prometheus on a cloud server and configure metrics collection.
  4. Install Grafana on the cloud server and log in to Grafana.
  5. Create a dashboard in Grafana.

Create a load balancer rule

carefully

After creating a rule with the PROMETHEUS protocol. the cloud load balancer metrics will be accessible from the Internet by IP address and port without authentication if:

  • The load balancer is on a private subnet and has a public IP address connected to it;
  • or the load balancer is on a public subnet.
  1. If the load balancer is on a private subnet and a public IP address is connected to it, create a cloud firewall.

    If the balancer is on a public subnet, you cannot close access to metrics.

  2. In control panels go to Cloud platformBalancers.

  3. Open the tab Balancers → balancer page.

  4. Click Create a rule.

  5. In the field Traffic reception protocol select an optionPrometheus.

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

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

  8. Click Create.

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 Create a cloud server.

Select:

  • source — any ready-made Ubuntu image, e.g. 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.

Install Prometheus on a cloud server and configure metrics collection

  1. Connect to the cloud server that you established Previously.

  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 configuration file prometheus.yml:

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

    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 look in control panels under Cloud platformBalancers → tab Balancers → load balancer page.

  5. Run Prometheus locally:

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

Install Grafana on the cloud server and log in to Grafana

  1. Connect to the cloud server that you established Previously.

  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 look in control panels under Cloud platformServers → server page → tab Ports → column Public IP.

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

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

  7. Click Submit.

Create a dashboard in Grafana

There is a ready-made dashboard for collecting Octavia metrics. Read more on the page OpenStack Octavia Amphora Load Balancer on Grafana's official website.

  1. Add a Data Source to Grafana. To do this, go to ConfigurationData sources.
  2. Click Add data source.
  3. Select the type of data source Prometheus.
  4. In the field URL enter http://localhost:9090.
  5. Click Save & test.
  6. Add a ready-made dashboard for Octavia metrics. To do this, go to the section Dashboards+ Import.
  7. In the field Import via grafana.com enter 15828.
  8. Click Load.
  9. In the field Prometheus select the Prometheus data source you created in step 5.
  10. Click Import.
  11. Make sure that the dashboard is created. To do this, go to DashboardsBrowse.
  12. Open the dashboard page OpenStack Octavia Amphora Load Balancer.

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 — target group metrics. Collected for each target group separately, differentiated by ID;
  • octavia_member — server metrics. Collected for each server separately, differentiated by ID.

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

MetricTypeDescription
octavia_loadbalancer_cpugaugePercentage vCPU load balancer vCPU usage
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