]> git.ipfire.org Git - thirdparty/pdns.git/commit
Add prometheus types/descriptions to dynamic metrics.
authorJess Bees <jesse@toomanybees.com>
Mon, 27 Oct 2025 14:44:39 +0000 (10:44 -0400)
committerJess Bees <jesse@toomanybees.com>
Mon, 27 Oct 2025 14:49:31 +0000 (10:49 -0400)
commit58b6580dff100582679ef90cb31473f6e9601a40
treeadee1e3d43692f215d3ec9c6f115b6e5bbf261ba
parent39f7f1b274cbe415d33a21e8997bf6a44c55285f
Add prometheus types/descriptions to dynamic metrics.

This commit adds optional types and descriptions to dynamic metrics, so
they can be written to the prometheus metrics web endpoint in comments.

Adds `initMetric` function to Lua, which is similar to getMetric, but
has two additional arguments: the metric's prometheus type, and the
metric's description. Metrics that are first declared with `getMetric`
will have no type or description, and subsequent calls to `initMetric`
will have no effect (the same way that calling `getMetric` multiple
times with different prometheus metric names will have no effect).

Signed-off-by: Jess Bees <jesse@toomanybees.com>
pdns/recursordist/lua-recursor4.cc
pdns/recursordist/rec_channel.hh
pdns/recursordist/rec_channel_rec.cc
pdns/recursordist/ws-recursor.cc