]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stats: fix show stat json buffer limitation
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 15 Dec 2022 13:17:09 +0000 (14:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 Dec 2022 15:53:49 +0000 (16:53 +0100)
commit42b18fb64522a20f58997782ccddc310c09958d8
tree26a198de8480eb44a93d8fe6ea0904e9986d87da
parent559418419048426faaa216f8bb9ad254f0052d4f
BUG/MINOR: stats: fix show stat json buffer limitation

json output type is a lot more verbose than other output types.
Because of this and the increasing number of metrics implemented within
haproxy, we are starting to reach max bufsize limit (defaults to 16k)
when dumping stats to json since 2.6-dev1.
This results in stats output being truncated with
    "[{"errorStr":"output buffer too short"}]"

This was reported by Gabriel in #1964.

Thanks to "MINOR: stats: introduce stats field ctx", we can now make
multipart (using multiple buffers) dumping, in case a single buffer is not big
enough to hold the complete stat line.
For now, only stats_dump_fields_json() makes use of it as it is by
far the most verbose stats output type.
(csv, typed and html outputs should be good for a while and may use this
capability if the need arises in some distant future)

--

It could be backported to 2.6 and 2.7.
This commit depends on:
  - MINOR: stats: provide ctx for dumping functions
  - MINOR: stats: introduce stats field ctx
src/stats.c