]> git.kaiwu.me - haproxy.git/commit
MEDIUM: otel: added CLI commands for runtime filter management
authorMiroslav Zagorac <mzagorac@haproxy.com>
Sun, 12 Apr 2026 09:31:30 +0000 (11:31 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 13 Apr 2026 07:23:26 +0000 (09:23 +0200)
commitcb4cb1065c00526d992e4259410c2009fdf14ae2
tree22c8fdda8036c5c8bd8a3f7d8dbc67391a371d48
parentb1498910ece7dc5a8a03db9c68217d2a42c1f661
MEDIUM: otel: added CLI commands for runtime filter management

Added HAProxy CLI commands that allow runtime inspection and modification
of OTel filter settings without requiring a configuration reload.

The new cli.c module registers CLI keywords under the "otel" prefix and
implements the following commands: flt_otel_cli_parse_status() displays a
comprehensive status report of all OTel filter instances including filter
ID, proxy, disabled state, hard-error mode, logging state, rate limit,
analyzer bits, and SDK diagnostic message count;
flt_otel_cli_parse_disabled() enables or disables filtering across all
instances; flt_otel_cli_parse_option() toggles the hard-error mode that
controls whether errors disable the filter for a stream or are silently
ignored; flt_otel_cli_parse_logging() manages the logging state with
support for off, on, and dontlog-normal modes; flt_otel_cli_parse_rate()
adjusts the sampling rate limit as a floating-point percentage; and
flt_otel_cli_parse_debug() sets the debug verbosity level in debug builds.
All modifications are applied atomically across every OTel filter instance
in every proxy.

The CLI initialization is called from flt_otel_ops_init() during filter
startup via flt_otel_cli_init(), which registers the keyword table through
cli_register_kw().

Supporting changes include the FLT_OTEL_U32_FLOAT macro for converting the
internal uint32_t rate representation to a human-readable percentage, the
FLT_OTEL_PROXIES_LIST_START/END iteration macros for traversing all OTel
filter instances across the proxy list, and flt_otel_filters_dump() for
debug logging of filter instances.
addons/otel/Makefile
addons/otel/include/cli.h [new file with mode: 0644]
addons/otel/include/define.h
addons/otel/include/include.h
addons/otel/include/util.h
addons/otel/src/cli.c [new file with mode: 0644]
addons/otel/src/filter.c
addons/otel/src/util.c