]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stats: define stats-file output format support
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 16 Apr 2024 16:17:48 +0000 (18:17 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 26 Apr 2024 08:20:57 +0000 (10:20 +0200)
commit83281303f69291d4df9b3e40ee8d098b6b3a3dd9
tree19ef1d71c69fb46727e0126cc84a5ea80cbdfdfa
parent66152526566ede3e6b716912ac0a4676f75d4245
MINOR: stats: define stats-file output format support

Prepare stats function to handle a new format labelled "stats-file". Its
purpose is to generate a statistics dump with a format closed from the
CSV output. Such output will be then used to preload haproxy internal
counters on process startup.

stats-file output differs from a standard CSV on several points. First,
only an excerpt of all statistics is outputted. All values that does not
make sense to preload are excluded. For the moment, stats-file only list
stats fully defined via "struct stat_col" method. Contrary to a CSV, sll
columns of a stats-file will be filled. As such, empty field value is
used to mark stats which should not be outputted.

Some adaptation specifics to stats-file are necessary into
me_generate_field(). First, stats-file will output separatedly values
from frontend and backend sides with their own respective set of
columns. As such, an empty field value is returned if stat is not
defined for either frontend/listener, or backend/server when outputting
the other side. Also, as stats-file does not support empty column,
stcol_hide() is not used for it.

A minor adjustement was necessary for stats_fill_fe_line() to pass
context flags. This is necessary to detect stat output format. All other
listener/server/backend corresponding functions already have it.
addons/promex/service-prometheus.c
include/haproxy/stats-t.h
include/haproxy/stats.h
src/hlua_fcn.c
src/stats.c