Skip to main content
Version: NG-2.13

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

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: bind <HAProxy-IP>:<stats-port>

  • 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 IPDestination IPDestination PortProtocolDirection
IP address of the HAProxy serverData Collector End Point9092*TCPInbound

*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

NameDescriptionData Type
binTotal incoming bytes to the proxy.UInt64
boutTotal outgoing bytes from the proxy.UInt64
nameThe name of the proxy or server instance.LowCardinality(String)
cache_hitsNumber of cache hits.UInt64
cache_lookupsTotal cache lookups attempted.UInt64
comp_bypNumber of HTTP responses bypassed for compression.UInt64
comp_inTotal number of bytes received for compression.UInt64
comp_outTotal number of bytes compressed and sent out.UInt64
comp_rspNumber of compressed HTTP responses.UInt32
conn_rateRate of new connections per second.Float64
conn_rate_maxMaximum connection rate recorded.Float64
conn_totTotal number of connections established.UInt64
dconNumber of denied connections (due to security restrictions, etc.).UInt32
dreqNumber of denied HTTP requests.UInt64
drespNumber of denied HTTP responses.UInt64
dsesNumber of denied sessions.UInt32
eintNumber of internal errors encountered.UInt32
ereqNumber of erroneous HTTP requests.UInt32
h2_backend_open_streamsNumber of currently open HTTP/2 streams on the backend.UInt32
h2_backend_total_streamsTotal number of HTTP/2 streams handled on the backend.UInt32
h2_data_rcvdTotal amount of HTTP/2 data received.UInt64
h2_detected_conn_protocol_errorsNumber of connection-level HTTP/2 protocol errors detected.UInt32
h2_detected_strm_protocol_errorsNumber of stream-level HTTP/2 protocol errors detected.UInt32
h2_goaway_rcvdNumber of GOAWAY frames received (in HTTP/2).UInt64
h2_goaway_respNumber of GOAWAY frames sent as a response (in HTTP/2).UInt64
h2_headers_rcvdTotal number of HTTP/2 headers received.UInt64
h2_open_connectionsCurrent number of open HTTP/2 connections.UInt32
h2_rst_stream_rcvdNumber of RST_STREAM frames received (in HTTP/2).UInt32
h2_rst_stream_respNumber of RST_STREAM frames sent (in HTTP/2).UInt32
h2_settings_rcvdNumber of SETTINGS frames received (in HTTP/2).UInt32
h2_total_connectionsTotal number of HTTP/2 connections.UInt64
http_response_1xxNumber of 1xx (informational) HTTP responses sent by HAProxy.UInt64
http_response_2xxNumber of 2xx (successful) HTTP responses sent by HAProxy.UInt64
http_response_3xxNumber of 3xx (redirection) HTTP responses sent by HAProxy.UInt64
http_response_4xxNumber of 4xx (client error) HTTP responses sent by HAProxy.UInt64
http_response_5xxNumber of 5xx (server error) HTTP responses sent by HAProxy.UInt64
http_response_otherNumber of other HTTP responses (non-1xx/2xx/3xx/4xx/5xx) sent by HAProxy.UInt64
iidInstance ID, unique to each HAProxy process or instance.UInt16
interceptedNumber of connections intercepted by HAProxy.UInt32
modeHAProxy mode (e.g., http, tcp). Defines the protocol level handled by the proxy.LowCardinality(String)
pidProcess ID of the HAProxy instance.UInt32
rateCurrent number of sessions per second handled by HAProxy.Float32
rate_limSession rate limit (sessions per second).Float32
rate_maxMaximum session rate per second observed by HAProxy.Float64
req_rateCurrent HTTP request rate (requests per second).Float64
req_rate_maxMaximum HTTP request rate observed (requests per second).Float64
req_totTotal number of HTTP requests processed.UInt64
scurCurrent number of active sessions.UInt64
sidServer ID used internally by HAProxy to identify each backend server.UInt32
slimMaximum number of concurrent sessions allowed.UInt64
smaxMaximum number of concurrent sessions observed.UInt64
ssl_failed_handshakeNumber of failed SSL/TLS handshakes.UInt32
ssl_reused_sessNumber of SSL sessions successfully reused.UInt32
ssl_sessTotal number of SSL/TLS sessions handled.UInt64
statusStatus of the backend or server (e.g., UP, DOWN).LowCardinality(String)
stotTotal number of sessions processed.UInt64
wrewNumber of failed write operations, usually due to client aborts or connection resets.UInt32
hostHostname of the server where HAProxy is running.String
proxyThe name of the proxy (frontend or backend) in HALowCardinality(String)
serverThe server's name, representing the backend server instance.String
svService version or identifier of the server instance.LowCardinality(String)
typeIndicates whether the row represents a frontend (0), backend (1), or server (2).LowCardinality(String)
timestampTimestamp of the data point, often representing when the metrics were collected.DateTime64
@timestampHuman-readable timestamp in string format, for easier interpretation.String
tenant_idThe tenant identifier in a multi-tenant environment.UInt8
bu_idBusiness unit identifier for multi-business environments.UInt8
active_serversThe current number of active backend servers.UInt64
agg_check_statusAggregated health check status for backend servers.UInt8
agg_server_check_statusAggregated health check status for individual backend servers.UInt8
agg_server_statusAggregated status of backend servers (e.g., online, offline).UInt8
backup_serversThe number of backup servers available in the backend.UInt32
chkdownCounter for the number of times a health check failed and the server went down.UInt32
cli_abortThe number of aborted client connections.UInt32
connectThe total number of successful connections made to the backend servers.UInt64
ctimeThe time taken to establish a connection, in milliseconds.UInt64
ctime_maxThe maximum time recorded for establishing a connection.UInt64
econThe number of connection errors.UInt32
erespThe number of response errors.UInt32
lastchgThe time (in seconds) since the last state change of the server (e.g., from up to down or vice versa).UInt64
lastsessTime (in milliseconds) since the last session was seen on this server.UInt64
lbtotThe total number of times a server was selected by load balancing.UInt64
qcurThe current number of queued requests.UInt64
qmaxThe maximum number of requests queued at a time.UInt64
qtimeThe average time (in milliseconds) spent by a request in the queue.UInt64
qtime_maxThe maximum time spent by a request in the queue.UInt64
reuseThe number of times a connection was reused.UInt64
rtimeThe average response time from the server, in milliseconds.UInt64
rtime_maxMaximum time taken for a request to be processed (in milliseconds).UInt64
srv_abortNumber of connections aborted by the server.UInt64
ttimeTotal time taken to process a request, including connection time and response time (in milliseconds).UInt64
ttime_maxMaximum total time taken to process a request (in milliseconds).UInt64
uweightDynamic weight of the server, reflecting the load or performance metrics.UInt16
weightStatic weight of the server used in load balancing decisions.UInt16
wredisNumber of requests that were retried due to redispatching.UInt64
wretrNumber of requests that were retried due to server errors or other issues.UInt64
hostHostname or IP address of the machine generating the logs.String
messageLog message content.String
input_typeType of input (e.g., syslog, file, etc.) for the log data.LowCardinality(String)
service_typeType of service generating the logs.LowCardinality(String)
typeType of log entry (e.g., access, error).LowCardinality(String)
targetTarget system or endpoint related to the log entry.String
ecs_versionVersion of the Elastic Common Schema used for logging.LowCardinality(String)
host_containerizedIndicates whether the host is containerized (1 for true, 0 for false).UInt8
host_ip_0Primary IP address of the host.String
hostnameHostname of the machine generating the logs.String
host_architectureArchitecture of the host (e.g., x86_64, ARM).LowCardinality(String)
host_os_typeType of operating system on the host (e.g., Linux, Windows).LowCardinality(String)
host_os_platformPlatform of the operating system (e.g., Ubuntu, CentOS).LowCardinality(String)
host_idUnique identifier for the host.String
log_offsetOffset in the log file where the entry starts.UInt64
log_file_pathPath to the log file on the host.String
event_moduleModule generating the event (e.g., HAProxy, Apache).LowCardinality(String)
event_datasetDataset associated with the event (e.g., access logs, error logs).LowCardinality(String)
event_timezoneTimezone in which the event occurred.String
fileset_nameName of the fileset for log organization.LowCardinality(String)
agent_versionVersion of the logging agent sending the data.LowCardinality(String)
agent_ephemeral_idEphemeral ID of the logging agent instance.String
agent_idUnique identifier for the logging agent.String
agent_nameName of the logging agent.LowCardinality(String)
agent_typeType of logging agent (e.g., Filebeat, Logstash).LowCardinality(String)
tenant_idIdentifier for the tenant associated with the log data.UInt8
bu_idBusiness unit identifier associated with the log data.UInt8
timestampTimestamp of when the log entry was created.DateTime64
log_timestampTimestamp in string format of the log entry.String
TTTotal time taken for a request or process (in milliseconds).Float64
server_nameName of the server handling the request.LowCardinality(String)
requestFull HTTP request line or log entry detail.String
TWTotal wait time (e.g., in HTTP/2 or other protocols).String
status_codeHTTP status code of the response.UInt64
actconnNumber of active connections.UInt64
srv_connNumber of connections to the backend server.UInt64
client_portPort number on the client side.UInt64
backend_nameName of the backend service.LowCardinality(String)
beconnNumber of connections to the backend server.UInt64
client_ipIP address of the client making the request.String
captured_response_cookieCookie captured from the response.String
methodHTTP method used (e.g., GET, POST).LowCardinality(String)
captured_request_cookieCookie captured from the request.String
termination_stateTermination state of the connection (e.g., normal, error).String
feconnNumber of connections to the frontend.UInt64
srv_queueNumber of requests queued on the backend server.UInt64
http_versionHTTP version used (e.g., 1.1, 2).String
bytes_readNumber of bytes read from the client.Float64
TCTotal connection time (in milliseconds).Float64
retriesNumber of retries for the request.UInt64
backend_queueNumber of requests queued on the backend.UInt64
accept_dateDate when the request was accepted.String
processidIdentifier of the process handling the request.Float64
frontend_nameName of the frontend handling the request.LowCardinality(String)
TQTotal queue time (in milliseconds).UInt64
TRTotal retries.UInt64