]> git.kaiwu.me - haproxy.git/commit
MINOR: otel: added flt_otel_sample_eval and exposed flt_otel_sample_add_kv
authorMiroslav Zagorac <mzagorac@haproxy.com>
Thu, 2 Apr 2026 14:03:12 +0000 (16:03 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 13 Apr 2026 07:23:26 +0000 (09:23 +0200)
commitd96ce16cef8ae6e2c494d9c3eec332899cbc969a
tree70cb77bd1751d0d0f06df8d379de3fb5ca35f8f1
parent20c740db8cbb6aef0beca5be0cda7b0c466454d5
MINOR: otel: added flt_otel_sample_eval and exposed flt_otel_sample_add_kv

Factored the sample evaluation logic out of flt_otel_sample_add() into a
new flt_otel_sample_eval() function that evaluates a sample definition
into an otelc_value.  Both the log-format path and the bare sample
expression path are handled, with a flag_native parameter controlling
native type preservation for single-expression samples.
flt_otel_sample_add() now calls flt_otel_sample_eval() and dispatches the
result.

Made flt_otel_sample_add_kv() non-static so callers outside util.c can
add key-value pairs directly to a bare flt_otel_scope_data_kv without
requiring the full flt_otel_scope_data structure.
addons/otel/README-func
addons/otel/include/util.h
addons/otel/src/util.c