]> git.kaiwu.me - haproxy.git/commit
MINOR: otel: added metrics instrument support
authorMiroslav Zagorac <mzagorac@haproxy.com>
Mon, 2 Mar 2026 08:41:57 +0000 (09:41 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 13 Apr 2026 07:23:26 +0000 (09:23 +0200)
commitbf05a014db0599ee9a138157d27db18694575c28
treefc5cc59ab7c58dc6635b883a09e5de15a31f1f84
parenteaa05d2af30a3d92cb8f59899b06e480106d409f
MINOR: otel: added metrics instrument support

Added the "instrument" keyword to otel-scope sections for recording metric
measurements alongside traces.

Introduced flt_otel_conf_instrument holding instrument type, description,
unit, sample expressions, and optional key-value attributes.  The
supported synchronous integer-precision instrument types were counters,
histograms, up-down counters, and gauges.

Instruments followed a two-form design: a "create" form defined a new
instrument with its type and value expression, while an "update" form
recorded measurements against an existing instrument with per-scope
attributes.

Instrument creation was performed lazily at first use with HA_ATOMIC_CAS
to guarantee thread-safe one-time initialization.  The configuration
check phase validated that every update-form had a matching create-form
definition and that create-form names were unique across all scopes.

The meter lifecycle was integrated into filter init and deinit, starting
the meter alongside the tracer and shutting it down during cleanup.
12 files changed:
addons/otel/include/conf.h
addons/otel/include/conf_funcs.h
addons/otel/include/define.h
addons/otel/include/parser.h
addons/otel/include/util.h
addons/otel/src/cli.c
addons/otel/src/conf.c
addons/otel/src/event.c
addons/otel/src/filter.c
addons/otel/src/parser.c
addons/otel/src/util.c
addons/otel/test/sa/otel.cfg