HAProxy
Introduction
HAProxy is a free and open source software that provides a high availability load balancer and Proxy (forward proxy, reverse proxy) for TCP and HTTP-based applications that spreads requests across multiple servers.
Getting Started
Compatibility
The HAProxy O11ySource is compatible with all versions greater than 2.4.24
Data Collection Method
vuSmartMaps collects health and performance data from HAProxy server using an internal data collector. This data collector collects data based on the source configuration. HAProxy logs are collected by VuNet's Logbeat agent
Prerequisites
Dependent Configuration
To configure this O11ySource, create a 'credential' of type 'user' under the 'Definition' tab.
Inputs for Configuring Data Source
-
HAProxy Server: The IP Address/FQDN of the Haproxy server. This field is the key to identify each server you add here.
-
Period [in seconds]: How frequently data is gathered. The period should be between 60 seconds – 3000 seconds.
-
URL: The server URL to HAProxy Eg:http://164.52.218.191:1936
-
Credential: This field is required
-
HAProxy Log Path: Enter the HAProxy logfile's entire path
Firewall Requirement
To collect data from this O11ySource, ensure the following ports are opened:
Source IP | Destination IP | Destination Port | Protocol | Direction |
---|---|---|---|---|
IP address of the HAProxy server | Data Collector End Point | 9092* | TCP | Inbound |
*Before providing the firewall requirements, please update the port based on the customer environment.
Configuring the Target
Configure Metrics Collection from HAProxy Server To collect data from HAProxy using the internal data collector agent, you may need to make some configurations on the HAProxy server side to allow access to the HAProxy statistics page. Here are the typical steps:
- In HAProxy configuration file (usually located at /etc/haproxy/haproxy.cfg), you need to enable the stats page by adding a section like this:
listen stats
bind <HAProxy-IP>:<stats-port> #e.g., bind 0.0.0.0:1936
mode http
stats enable
stats uri /haproxy?stats
stats auth <username>:<password<> #optional, if you want to protect the stats page
Replace with the actual IP address of your HAProxy server, with the port you want to use for the stats page (e.g., 1936), and with the credentials you want to use to access the stats page (optional). And then restart the HAProxy service to apply the new configuration.
Configuration Steps
- Enable the HAProxy O11ySource.
- Select the Sources tab and press the
+
button to add a new HAProxy host to be monitored. - Set up metrics and log collection configurations. Afterwards, select
Save and Continue
to proceed with downloading the Logbeat agent. - The following packages will be available for download based on the OS:Download <OS> Logbeat Installation Binary - Downloads the full Logbeat package with required configurations for a fresh installationDownload <OS> Logbeat Update Configuration Binary - Downloads the agent configuration package to update an existing Logbeat installation
- Download the agent installation or update package, then click
Finish
to close the data source window.
Metrics Collected
Name | Description | Data Type |
---|---|---|
bin | Total incoming bytes to the proxy. | UInt64 |
bout | Total outgoing bytes from the proxy. | UInt64 |
name | The name of the proxy or server instance. | LowCardinality(String) |
cache_hits | Number of cache hits. | UInt64 |
cache_lookups | Total cache lookups attempted. | UInt64 |
comp_byp | Number of HTTP responses bypassed for compression. | UInt64 |
comp_in | Total number of bytes received for compression. | UInt64 |
comp_out | Total number of bytes compressed and sent out. | UInt64 |
comp_rsp | Number of compressed HTTP responses. | UInt32 |
conn_rate | Rate of new connections per second. | Float64 |
conn_rate_max | Maximum connection rate recorded. | Float64 |
conn_tot | Total number of connections established. | UInt64 |
dcon | Number of denied connections (due to security restrictions, etc.). | UInt32 |
dreq | Number of denied HTTP requests. | UInt64 |
dresp | Number of denied HTTP responses. | UInt64 |
dses | Number of denied sessions. | UInt32 |
eint | Number of internal errors encountered. | UInt32 |
ereq | Number of erroneous HTTP requests. | UInt32 |
h2_backend_open_streams | Number of currently open HTTP/2 streams on the backend. | UInt32 |
h2_backend_total_streams | Total number of HTTP/2 streams handled on the backend. | UInt32 |
h2_data_rcvd | Total amount of HTTP/2 data received. | UInt64 |
h2_detected_conn_protocol_errors | Number of connection-level HTTP/2 protocol errors detected. | UInt32 |
h2_detected_strm_protocol_errors | Number of stream-level HTTP/2 protocol errors detected. | UInt32 |
h2_goaway_rcvd | Number of GOAWAY frames received (in HTTP/2). | UInt64 |
h2_goaway_resp | Number of GOAWAY frames sent as a response (in HTTP/2). | UInt64 |
h2_headers_rcvd | Total number of HTTP/2 headers received. | UInt64 |
h2_open_connections | Current number of open HTTP/2 connections. | UInt32 |
h2_rst_stream_rcvd | Number of RST_STREAM frames received (in HTTP/2). | UInt32 |
h2_rst_stream_resp | Number of RST_STREAM frames sent (in HTTP/2). | UInt32 |
h2_settings_rcvd | Number of SETTINGS frames received (in HTTP/2). | UInt32 |
h2_total_connections | Total number of HTTP/2 connections. | UInt64 |
http_response_1xx | Number of 1xx (informational) HTTP responses sent by HAProxy. | UInt64 |
http_response_2xx | Number of 2xx (successful) HTTP responses sent by HAProxy. | UInt64 |
http_response_3xx | Number of 3xx (redirection) HTTP responses sent by HAProxy. | UInt64 |
http_response_4xx | Number of 4xx (client error) HTTP responses sent by HAProxy. | UInt64 |
http_response_5xx | Number of 5xx (server error) HTTP responses sent by HAProxy. | UInt64 |
http_response_other | Number of other HTTP responses (non-1xx/2xx/3xx/4xx/5xx) sent by HAProxy. | UInt64 |
iid | Instance ID, unique to each HAProxy process or instance. | UInt16 |
intercepted | Number of connections intercepted by HAProxy. | UInt32 |
mode | HAProxy mode (e.g., http, tcp). Defines the protocol level handled by the proxy. | LowCardinality(String) |
pid | Process ID of the HAProxy instance. | UInt32 |
rate | Current number of sessions per second handled by HAProxy. | Float32 |
rate_lim | Session rate limit (sessions per second). | Float32 |
rate_max | Maximum session rate per second observed by HAProxy. | Float64 |
req_rate | Current HTTP request rate (requests per second). | Float64 |
req_rate_max | Maximum HTTP request rate observed (requests per second). | Float64 |
req_tot | Total number of HTTP requests processed. | UInt64 |
scur | Current number of active sessions. | UInt64 |
sid | Server ID used internally by HAProxy to identify each backend server. | UInt32 |
slim | Maximum number of concurrent sessions allowed. | UInt64 |
smax | Maximum number of concurrent sessions observed. | UInt64 |
ssl_failed_handshake | Number of failed SSL/TLS handshakes. | UInt32 |
ssl_reused_sess | Number of SSL sessions successfully reused. | UInt32 |
ssl_sess | Total number of SSL/TLS sessions handled. | UInt64 |
status | Status of the backend or server (e.g., UP, DOWN). | LowCardinality(String) |
stot | Total number of sessions processed. | UInt64 |
wrew | Number of failed write operations, usually due to client aborts or connection resets. | UInt32 |
host | Hostname of the server where HAProxy is running. | String |
proxy | The name of the proxy (frontend or backend) in HA | LowCardinality(String) |
server | The server's name, representing the backend server instance. | String |
sv | Service version or identifier of the server instance. | LowCardinality(String) |
type | Indicates whether the row represents a frontend (0), backend (1), or server (2). | LowCardinality(String) |
timestamp | Timestamp of the data point, often representing when the metrics were collected. | DateTime64 |
@timestamp | Human-readable timestamp in string format, for easier interpretation. | String |
tenant_id | The tenant identifier in a multi-tenant environment. | UInt8 |
bu_id | Business unit identifier for multi-business environments. | UInt8 |
active_servers | The current number of active backend servers. | UInt64 |
agg_check_status | Aggregated health check status for backend servers. | UInt8 |
agg_server_check_status | Aggregated health check status for individual backend servers. | UInt8 |
agg_server_status | Aggregated status of backend servers (e.g., online, offline). | UInt8 |
backup_servers | The number of backup servers available in the backend. | UInt32 |
chkdown | Counter for the number of times a health check failed and the server went down. | UInt32 |
cli_abort | The number of aborted client connections. | UInt32 |
connect | The total number of successful connections made to the backend servers. | UInt64 |
ctime | The time taken to establish a connection, in milliseconds. | UInt64 |
ctime_max | The maximum time recorded for establishing a connection. | UInt64 |
econ | The number of connection errors. | UInt32 |
eresp | The number of response errors. | UInt32 |
lastchg | The time (in seconds) since the last state change of the server (e.g., from up to down or vice versa). | UInt64 |
lastsess | Time (in milliseconds) since the last session was seen on this server. | UInt64 |
lbtot | The total number of times a server was selected by load balancing. | UInt64 |
qcur | The current number of queued requests. | UInt64 |
qmax | The maximum number of requests queued at a time. | UInt64 |
qtime | The average time (in milliseconds) spent by a request in the queue. | UInt64 |
qtime_max | The maximum time spent by a request in the queue. | UInt64 |
reuse | The number of times a connection was reused. | UInt64 |
rtime | The average response time from the server, in milliseconds. | UInt64 |
rtime_max | Maximum time taken for a request to be processed (in milliseconds). | UInt64 |
srv_abort | Number of connections aborted by the server. | UInt64 |
ttime | Total time taken to process a request, including connection time and response time (in milliseconds). | UInt64 |
ttime_max | Maximum total time taken to process a request (in milliseconds). | UInt64 |
uweight | Dynamic weight of the server, reflecting the load or performance metrics. | UInt16 |
weight | Static weight of the server used in load balancing decisions. | UInt16 |
wredis | Number of requests that were retried due to redispatching. | UInt64 |
wretr | Number of requests that were retried due to server errors or other issues. | UInt64 |
host | Hostname or IP address of the machine generating the logs. | String |
message | Log message content. | String |
input_type | Type of input (e.g., syslog, file, etc.) for the log data. | LowCardinality(String) |
service_type | Type of service generating the logs. | LowCardinality(String) |
type | Type of log entry (e.g., access, error). | LowCardinality(String) |
target | Target system or endpoint related to the log entry. | String |
ecs_version | Version of the Elastic Common Schema used for logging. | LowCardinality(String) |
host_containerized | Indicates whether the host is containerized (1 for true, 0 for false). | UInt8 |
host_ip_0 | Primary IP address of the host. | String |
hostname | Hostname of the machine generating the logs. | String |
host_architecture | Architecture of the host (e.g., x86_64, ARM). | LowCardinality(String) |
host_os_type | Type of operating system on the host (e.g., Linux, Windows). | LowCardinality(String) |
host_os_platform | Platform of the operating system (e.g., Ubuntu, CentOS). | LowCardinality(String) |
host_id | Unique identifier for the host. | String |
log_offset | Offset in the log file where the entry starts. | UInt64 |
log_file_path | Path to the log file on the host. | String |
event_module | Module generating the event (e.g., HAProxy, Apache). | LowCardinality(String) |
event_dataset | Dataset associated with the event (e.g., access logs, error logs). | LowCardinality(String) |
event_timezone | Timezone in which the event occurred. | String |
fileset_name | Name of the fileset for log organization. | LowCardinality(String) |
agent_version | Version of the logging agent sending the data. | LowCardinality(String) |
agent_ephemeral_id | Ephemeral ID of the logging agent instance. | String |
agent_id | Unique identifier for the logging agent. | String |
agent_name | Name of the logging agent. | LowCardinality(String) |
agent_type | Type of logging agent (e.g., Filebeat, Logstash). | LowCardinality(String) |
tenant_id | Identifier for the tenant associated with the log data. | UInt8 |
bu_id | Business unit identifier associated with the log data. | UInt8 |
timestamp | Timestamp of when the log entry was created. | DateTime64 |
log_timestamp | Timestamp in string format of the log entry. | String |
TT | Total time taken for a request or process (in milliseconds). | Float64 |
server_name | Name of the server handling the request. | LowCardinality(String) |
request | Full HTTP request line or log entry detail. | String |
TW | Total wait time (e.g., in HTTP/2 or other protocols). | String |
status_code | HTTP status code of the response. | UInt64 |
actconn | Number of active connections. | UInt64 |
srv_conn | Number of connections to the backend server. | UInt64 |
client_port | Port number on the client side. | UInt64 |
backend_name | Name of the backend service. | LowCardinality(String) |
beconn | Number of connections to the backend server. | UInt64 |
client_ip | IP address of the client making the request. | String |
captured_response_cookie | Cookie captured from the response. | String |
method | HTTP method used (e.g., GET, POST). | LowCardinality(String) |
captured_request_cookie | Cookie captured from the request. | String |
termination_state | Termination state of the connection (e.g., normal, error). | String |
feconn | Number of connections to the frontend. | UInt64 |
srv_queue | Number of requests queued on the backend server. | UInt64 |
http_version | HTTP version used (e.g., 1.1, 2). | String |
bytes_read | Number of bytes read from the client. | Float64 |
TC | Total connection time (in milliseconds). | Float64 |
retries | Number of retries for the request. | UInt64 |
backend_queue | Number of requests queued on the backend. | UInt64 |
accept_date | Date when the request was accepted. | String |
processid | Identifier of the process handling the request. | Float64 |
frontend_name | Name of the frontend handling the request. | LowCardinality(String) |
TQ | Total queue time (in milliseconds). | UInt64 |
TR | Total retries. | UInt64 |