]> git.kaiwu.me - haproxy.git/commit
MEDIUM: otel: added configuration and utility layer
authorMiroslav Zagorac <mzagorac@haproxy.com>
Sun, 12 Apr 2026 05:30:57 +0000 (07:30 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 13 Apr 2026 07:23:26 +0000 (09:23 +0200)
commit8126fd569b79a550cc1b165b8c288aeb96e1ada3
tree3103d15f8c102e832897972a7ead0e2e3b63f44d
parentcd14abf9f3c391f0de6b34c3371706476d1ca4b2
MEDIUM: otel: added configuration and utility layer

Added the configuration structures that model the OTel filter's
instrumentation hierarchy and the utility functions that support the
configuration parser.

The configuration is organized as a tree rooted at flt_otel_conf, which
holds the proxy reference, filter identity, and lists of groups and
scopes.  Below it, flt_otel_conf_instr carries the instrumentation
settings: tracer handle, rate limiting, hard-error mode, logging state,
channel analyzers, and placeholder references to groups and scopes.
Groups (flt_otel_conf_group) aggregate scopes by name.  Scopes
(flt_otel_conf_scope) bind an event to its ACL condition, span context
declarations, span definitions and a list of spans scheduled for
finishing.  Spans (flt_otel_conf_span) carry attributes, events,
baggages and status entries, each represented as flt_otel_conf_sample
structures that pair a key with concatenated sample-expression arguments.

All configuration types share a common header macro (FLT_OTEL_CONF_HDR)
that embeds an identifier string, its length, a configuration line number,
and a list link.  Their init and free functions are generated by the
FLT_OTEL_CONF_FUNC_INIT and FLT_OTEL_CONF_FUNC_FREE macros in
conf_funcs.h, with per-type custom initialization and cleanup bodies.

The utility layer in util.c provides argument counting and concatenation
for the configuration parser, sample data to string conversion covering
boolean, integer, IPv4, IPv6, string and HTTP method types, and debug
helpers for dumping argument arrays and linked list state.
addons/otel/Makefile
addons/otel/include/conf.h [new file with mode: 0644]
addons/otel/include/conf_funcs.h [new file with mode: 0644]
addons/otel/include/config.h
addons/otel/include/define.h
addons/otel/include/include.h
addons/otel/include/util.h [new file with mode: 0644]
addons/otel/src/conf.c [new file with mode: 0644]
addons/otel/src/parser.c
addons/otel/src/util.c [new file with mode: 0644]