mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-04-19 04:32:57 +02:00
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.