Skip to content

fix: report bind_recursive_clients as a gauge - #288

Open
SaiPisey2 wants to merge 1 commit into
prometheus-community:masterfrom
SaiPisey2:fix/recursive-clients-gauge
Open

fix: report bind_recursive_clients as a gauge#288
SaiPisey2 wants to merge 1 commit into
prometheus-community:masterfrom
SaiPisey2:fix/recursive-clients-gauge

Conversation

@SaiPisey2

Copy link
Copy Markdown

Fixes #98

bind_recursive_clients is the number of recursive clients currently being served, so it goes up and down. It was reported as a counter.

The cause is that RecursClients lives in serverMetricStats, and the emission loop typed every entry in that map as CounterValue. Every other entry in the map is a real total and ends in _total; this one doesn't, so the name was already right and only the type was wrong.

This marks RecursClients as a gauge and types the map entries explicitly. Sample values are unchanged.

Same kind of fix as [BUGFIX] Fix Gauge type for large gauges #90, so I've treated it as a bugfix rather than a breaking change. rate() over this series was never meaningful anyway, since it isn't monotonic.

The tests only asserted the sample line, so I added the type assertion too. It fails on master with # TYPE bind_recursive_clients counter and passes with the change.

BIND reports RecursClients in the same statistics counters as the running
totals, and the exporter typed every entry of serverMetricStats as a
counter. RecursClients is the number of recursive clients currently being
served, so it goes up and down and is a gauge.

The metric name already reflects that: every other entry in the map ends
in _total, and this one does not.

Type the entries explicitly and mark RecursClients as a gauge. The sample
value is unchanged, only the reported type. Rates computed over it were
meaningless before this, since the series is not monotonic.

Asserts the type in the exporter tests, which previously only covered the
sample line.

Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metric bind_recursive_clients bad type

1 participant