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.
53 lines
1 KiB
C
53 lines
1 KiB
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
|
|
#ifndef _OTEL_INCLUDE_H_
|
|
#define _OTEL_INCLUDE_H_
|
|
|
|
#include <errno.h>
|
|
#include <stdbool.h>
|
|
#include <math.h>
|
|
#include <values.h>
|
|
|
|
#include <haproxy/api.h>
|
|
#include <haproxy/cfgparse.h>
|
|
#include <haproxy/acl.h>
|
|
#include <haproxy/cli.h>
|
|
#include <haproxy/clock.h>
|
|
#include <haproxy/filters.h>
|
|
#include <haproxy/http_htx.h>
|
|
#include <haproxy/http_rules.h>
|
|
#include <haproxy/log.h>
|
|
#include <haproxy/proxy.h>
|
|
#include <haproxy/sample.h>
|
|
#include <haproxy/tcp_rules.h>
|
|
#include <haproxy/tools.h>
|
|
#include <haproxy/vars.h>
|
|
|
|
#include <opentelemetry-c-wrapper/include.h>
|
|
|
|
#include "config.h"
|
|
#include "debug.h"
|
|
#include "define.h"
|
|
#include "cli.h"
|
|
#include "event.h"
|
|
#include "conf.h"
|
|
#include "conf_funcs.h"
|
|
#include "filter.h"
|
|
#include "http.h"
|
|
#include "otelc.h"
|
|
#include "parser.h"
|
|
#include "pool.h"
|
|
#include "scope.h"
|
|
#include "util.h"
|
|
#include "vars.h"
|
|
|
|
#endif /* _OTEL_INCLUDE_H_ */
|
|
|
|
/*
|
|
* Local variables:
|
|
* c-indent-level: 8
|
|
* c-basic-offset: 8
|
|
* End:
|
|
*
|
|
* vi: noexpandtab shiftwidth=8 tabstop=8
|
|
*/
|