OpenTelemetry
Manage the HAProxy OpenTelemetry filter with the HAProxy Runtime API
This page applies to:
- HAProxy 3.4 and newer
After you’ve enabled the HAProxy OpenTelemetry filter, you can call the following HAProxy Runtime API commands.
| Command | Description |
|---|---|
flt-otel debug [level] |
Set or show the debug level (if compiled with OTEL_DEBUG). |
flt-otel disable |
Disable the filter. |
flt-otel enable |
Enable the filter. |
flt-otel flush |
Force-export buffered telemetry. |
flt-otel hard-errors |
Enable hard-errors mode. |
flt-otel instruments |
Show configured metric instruments. |
flt-otel logging [state] |
Set the logging state. |
flt-otel rate [value] |
Set or show the rate limit. |
flt-otel scopes |
Show configured scopes and groups. |
flt-otel soft-errors |
Disable hard-errors mode. |
flt-otel status |
Show the filter status. |
flt-otel debug Jump to heading
Set or show the debug level (if compiled with OTEL_DEBUG).
Show the current debug level
nixecho "flt-otel debug" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel debug" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : current debug level is 1919 (0x077f)
outputtextflt-otel : current debug level is 1919 (0x077f)
flt-otel disable Jump to heading
Disable the filter.
nixecho "flt-otel disable" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel disable" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : filter disabled
outputtextflt-otel : filter disabled
flt-otel enable Jump to heading
Enable the filter.
nixecho "flt-otel enable" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel enable" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : filter enabled
outputtextflt-otel : filter enabled
flt-otel flush Jump to heading
Force-export buffered telemetry.
nixecho "flt-otel flush" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel flush" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : flushed proxy mysite, filter my-otel-filter
outputtextflt-otel : flushed proxy mysite, filter my-otel-filter
flt-otel hard-errors Jump to heading
Enable hard-errors mode. In hard-errors mode, processing of the stream stops as soon as the first error occurs. In soft-errors mode, processing of the stream continues without interruption if there is an error. Errors are caused by incorrect configuration of the instrumentation or are related to the operation of HAProxy.
nixecho "flt-otel hard-errors" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel hard-errors" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : filter set hard-errors
outputtextflt-otel : filter set hard-errors
flt-otel instruments Jump to heading
Show configured metric instruments.
nixecho "flt-otel instruments" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel instruments" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextopentelemetry filter instruments------------------------------------------------------------------------------proxy mysite, filter my-otel-filterscope instrument type unit statefrontend_http_request haproxy.sessions.active udcnt_int {session} created (idx 0)frontend_http_request haproxy.sessions.active updatefrontend_http_request haproxy.http.requests cnt_int {request} created (idx 1)frontend_http_request haproxy.http.requests updatefrontend_http_request haproxy.fe.connections gauge_int {connection} created (idx 2)frontend_http_request haproxy.fe.connections updateserver_session_start haproxy.server.session.start cnt_int {session} created (idx 3)server_session_start haproxy.server.session.start updateserver_session_end haproxy.sessions.active update
outputtextopentelemetry filter instruments------------------------------------------------------------------------------proxy mysite, filter my-otel-filterscope instrument type unit statefrontend_http_request haproxy.sessions.active udcnt_int {session} created (idx 0)frontend_http_request haproxy.sessions.active updatefrontend_http_request haproxy.http.requests cnt_int {request} created (idx 1)frontend_http_request haproxy.http.requests updatefrontend_http_request haproxy.fe.connections gauge_int {connection} created (idx 2)frontend_http_request haproxy.fe.connections updateserver_session_start haproxy.server.session.start cnt_int {session} created (idx 3)server_session_start haproxy.server.session.start updateserver_session_end haproxy.sessions.active update
flt-otel logging Jump to heading
Show the current logging state or set the logging state to on, off, or dontlog-normal. This is enabled when you have a log directive in the otel-instrumentation section, such as log global.
Show the current logging state
nixecho "flt-otel logging" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel logging" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : logging is currently enabled
outputtextflt-otel : logging is currently enabled
Disable logging
nixecho "flt-otel logging off" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel logging off" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : logging is disabled
outputtextflt-otel : logging is disabled
Enable logging
nixecho "flt-otel logging on" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel logging on" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : logging is enabled
outputtextflt-otel : logging is enabled
flt-otel rate Jump to heading
Set or show the rate limit.
Show the current rate limit
nixecho "flt-otel rate" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel rate" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : current rate limit is 100.00
outputtextflt-otel : current rate limit is 100.00
Set the rate limit to 50%
nixecho "flt-otel rate 50.0" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel rate 50.0" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : rate limit set to 50.00
outputtextflt-otel : rate limit set to 50.00
flt-otel scopes Jump to heading
Show configured scopes and groups.
nixecho "flt-otel scopes" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel scopes" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextopentelemetry filter scopes------------------------------------------------------------------------------proxy mysite, filter my-otel-filterscopes:scope event usedfrontend_http_request on-frontend-http-request yesbackend_http_request on-backend-http-request yesprocess_request on-http-process-request yesfinish_http_request on-http-end-request yesserver_session_start on-server-session-start yeswait_for_response on-http-wait-response yeshttp_response on-http-response yeshttp_response_end on-http-end-response yesserver_session_end on-server-session-end yes(no groups)events:event dispatchedon-stream-start 1on-stream-stop 1on-client-session-start 1on-backend-set 1on-frontend-http-request 1on-backend-http-request 1on-http-process-request 1on-http-headers-request 1on-http-end-request 1on-client-session-end 1on-server-session-start 1on-http-wait-response 1on-http-response 1on-http-headers-response 1on-http-end-response 1on-server-session-end 1
outputtextopentelemetry filter scopes------------------------------------------------------------------------------proxy mysite, filter my-otel-filterscopes:scope event usedfrontend_http_request on-frontend-http-request yesbackend_http_request on-backend-http-request yesprocess_request on-http-process-request yesfinish_http_request on-http-end-request yesserver_session_start on-server-session-start yeswait_for_response on-http-wait-response yeshttp_response on-http-response yeshttp_response_end on-http-end-response yesserver_session_end on-server-session-end yes(no groups)events:event dispatchedon-stream-start 1on-stream-stop 1on-client-session-start 1on-backend-set 1on-frontend-http-request 1on-backend-http-request 1on-http-process-request 1on-http-headers-request 1on-http-end-request 1on-client-session-end 1on-server-session-start 1on-http-wait-response 1on-http-response 1on-http-headers-response 1on-http-end-response 1on-server-session-end 1
flt-otel soft-errors Jump to heading
Disable hard-errors mode. In soft-errors mode, processing of the stream continues without interruption if there is an error. In hard-errors mode, processing of the stream stops as soon as the first error occurs. Errors are caused by incorrect configuration of the instrumentation or are related to the operation of HAProxy.
nixecho "flt-otel soft-errors" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel soft-errors" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextflt-otel : filter set soft-errors
outputtextflt-otel : filter set soft-errors
flt-otel status Jump to heading
Show the filter status.
nixecho "flt-otel status" | sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "flt-otel status" | sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtextopentelemetry filter status------------------------------------------------------------------------------library: C++ 1.26.0, C wrapper 2.0.0-862debug level: 0x7fdropped count: spans 0, logs 0, sdk 0proxy mysite, filter my-otel-filterconfiguration: /etc/haproxy/instrumentation.cfggroups/scopes: 0/9instrumentation my-instrumentationconfiguration: /etc/haproxy/otel-client.yamltracer: activemeter: activelogger: activerate limit: 100.00 %hard errors: nodisabled: nologging: disabledidle timeout: 0 msanalyzers: 01400910countersattached: run 1, rate-limit 0, disabled 0, error 0disabled: scope 0, hard-error 0
outputtextopentelemetry filter status------------------------------------------------------------------------------library: C++ 1.26.0, C wrapper 2.0.0-862debug level: 0x7fdropped count: spans 0, logs 0, sdk 0proxy mysite, filter my-otel-filterconfiguration: /etc/haproxy/instrumentation.cfggroups/scopes: 0/9instrumentation my-instrumentationconfiguration: /etc/haproxy/otel-client.yamltracer: activemeter: activelogger: activerate limit: 100.00 %hard errors: nodisabled: nologging: disabledidle timeout: 0 msanalyzers: 01400910countersattached: run 1, rate-limit 0, disabled 0, error 0disabled: scope 0, hard-error 0
See also Jump to heading
- See instructions for installing the HAProxy Runtime API.
- The HAProxy OpenTelemetry GitHub documentation describes the Otel CLI HAProxy Runtime API commands.