mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
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.
28 lines
808 B
C
28 lines
808 B
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
|
|
#ifndef _OTEL_CLI_H_
|
|
#define _OTEL_CLI_H_
|
|
|
|
#define FLT_OTEL_CLI_CMD "flt-otel"
|
|
|
|
#define FLT_OTEL_CLI_LOGGING_OFF "off"
|
|
#define FLT_OTEL_CLI_LOGGING_ON "on"
|
|
#define FLT_OTEL_CLI_LOGGING_NOLOGNORM "dontlog-normal"
|
|
#define FLT_OTEL_CLI_LOGGING_STATE(a) (((a) & FLT_OTEL_LOGGING_ON) ? (((a) & FLT_OTEL_LOGGING_NOLOGNORM) ? "enabled, " FLT_OTEL_CLI_LOGGING_NOLOGNORM : "enabled") : "disabled")
|
|
|
|
#define FLT_OTEL_CLI_MSG_CAT(a) (((a) == NULL) ? "" : (a)), (((a) == NULL) ? "" : "\n")
|
|
|
|
|
|
/* Register CLI keywords for the OTel filter. */
|
|
void flt_otel_cli_init(void);
|
|
|
|
#endif /* _OTEL_CLI_H_ */
|
|
|
|
/*
|
|
* Local variables:
|
|
* c-indent-level: 8
|
|
* c-basic-offset: 8
|
|
* End:
|
|
*
|
|
* vi: noexpandtab shiftwidth=8 tabstop=8
|
|
*/
|