Enterprise modules
Use the HAProxy Enterprise OpenTelemetry module
This page applies to:
- HAProxy Enterprise 3.2r1 and newer
HAProxy Enterprise’s OpenTelemetry module enables you to collect traffic data and use it to generate traces, metrics, and logs. Through the OpenTelemetry protocol, which many software products implement, you can export that data to a number of third-party solutions that let you visualize how traffic is flowing through the load balancer. Use the information to spot bottlenecks and to correlate one signal with another, such as to connect log records with traces.
On this page, you’ll learn how to install the module. Then, follow up with steps for customizing which events to monitor and where to send the data.
Install the OpenTelemetry module Jump to heading
-
Install the OpenTelemetry module according to your platform:
Install the OpenTelemetry modulenixsudo apt-get install hapee-3.4r1-lb-opentelemetrynixsudo apt-get install hapee-3.4r1-lb-opentelemetrynixsudo yum install hapee-3.4r1-lb-opentelemetrynixsudo yum install hapee-3.4r1-lb-opentelemetrynixsudo zypper install hapee-3.4r1-lb-opentelemetrynixsudo zypper install hapee-3.4r1-lb-opentelemetrynixsudo pkg install hapee-3.4r1-lb-opentelemetrynixsudo pkg install hapee-3.4r1-lb-opentelemetrynixsudo apt-get install hapee-3.3r1-lb-opentelemetrynixsudo apt-get install hapee-3.3r1-lb-opentelemetrynixsudo yum install hapee-3.3r1-lb-opentelemetrynixsudo yum install hapee-3.3r1-lb-opentelemetrynixsudo zypper install hapee-3.3r1-lb-opentelemetrynixsudo zypper install hapee-3.3r1-lb-opentelemetrynixsudo pkg install hapee-3.3r1-lb-opentelemetrynixsudo pkg install hapee-3.3r1-lb-opentelemetrynixsudo apt-get install hapee-3.2r1-lb-opentelemetrynixsudo apt-get install hapee-3.2r1-lb-opentelemetrynixsudo yum install hapee-3.2r1-lb-opentelemetrynixsudo yum install hapee-3.2r1-lb-opentelemetrynixsudo zypper install hapee-3.2r1-lb-opentelemetrynixsudo zypper install hapee-3.2r1-lb-opentelemetrynixsudo pkg install hapee-3.2r1-lb-opentelemetrynixsudo pkg install hapee-3.2r1-lb-opentelemetryInstalling the module creates these files in the
/etc/hapee-<VERSION>/directory:instrumentation.cfg: The instrumentation file is where you define the load balancer events to include in OpenTelemetry traces, metrics, and logs. This file defines some default settings, which you can customize.otel-client.yaml:The client library configuration file controls the underlying OpenTelemetry C++ client, which is responsible for batching and exporting metrics, traces, and logs to a remote endpoint where the data can be processed and displayed.
-
In your load balancer configuration, update the
globalsection to have amodule-loaddirective. Set its value tohapee-lb-opentelemetry.so.hapee-lb.cfghaproxyglobal...module-load hapee-lb-opentelemetry.sohapee-lb.cfghaproxyglobal...module-load hapee-lb-opentelemetry.so -
Update your
frontendsection to have afilter opentelemetrydirective. This enables instrumentation, which you’ll configure with the fileinstrumentation.cfg. Thefilter opentelemetrydirective has these arguments:idsets a unique identifier for this filter.configindicates the path to the instrumentation file.
Add an OpenTelemetry filterhapee-lb.cfghaproxyfrontend myfrontend...filter opentelemetry id my-otel-filter config /etc/hapee-3.4/instrumentation.cfghapee-lb.cfghaproxyfrontend myfrontend...filter opentelemetry id my-otel-filter config /etc/hapee-3.4/instrumentation.cfghapee-lb.cfghaproxyfrontend myfrontend...filter opentelemetry id my-otel-filter config /etc/hapee-3.3/instrumentation.cfghapee-lb.cfghaproxyfrontend myfrontend...filter opentelemetry id my-otel-filter config /etc/hapee-3.3/instrumentation.cfghapee-lb.cfghaproxyfrontend myfrontend...filter opentelemetry id my-otel-filter config /etc/hapee-3.2/instrumentation.cfghapee-lb.cfghaproxyfrontend myfrontend...filter opentelemetry id my-otel-filter config /etc/hapee-3.2/instrumentation.cfg -
Reload the HAProxy Enterprise configuration to apply the changes.
Reload HAProxy Enterprisenixsudo systemctl reload hapee-3.4-lbnixsudo systemctl reload hapee-3.4-lbnixsudo systemctl reload hapee-3.3-lbnixsudo systemctl reload hapee-3.3-lbnixsudo systemctl reload hapee-3.2-lbnixsudo systemctl reload hapee-3.2-lb
Next steps Jump to heading
After installing the OpenTelemetry module, here’s what to do next:
-
Set up OpenTelemetry Collector for testing: The
otel-client.yamlfile is configured to send OpenTelemetry data to the load balancer’s own address,http://localhost:4318. For testing, you can run OpenTelemetry Collector there. Or, edit the file and send data to a different destination, such as your own OpenTelemetry Collector, Jaeger, or other software. -
Read the HAProxy OpenTelemetry tutorials to learn how to configure logs, metrics, and traces.