Skip to content

bind: query the zones resource only for the view group - #306

Open
vignesh2027 wants to merge 1 commit into
prometheus-community:masterfrom
vignesh2027:zones-only-with-view-group
Open

vignesh2027 wants to merge 1 commit into
prometheus-community:masterfrom
vignesh2027:zones-only-with-view-group

Conversation

@vignesh2027

Copy link
Copy Markdown

The zone serials are exported by the view collector, but both the JSON and the XML client requested the zones resource on every scrape, whatever --bind.stats-groups said. With only server or tasks enabled that was an extra request per scrape, which is costly on servers with thousands of zones (see #210). If that request failed, bind_up went to 0 and the server metrics were dropped as well.

This only queries the zones resource when the view group is enabled. Default behaviour is unchanged, since the default groups are server,view. One visible difference: with --bind.stats-groups set to an empty list the exporter now makes no requests at all and reports bind_up 1, where before the zones request alone decided bind_up.

TestBindExporterBindFailure had no groups set and only saw bind_up 0 because the zones request failed. It now enables server and view explicitly. New tests make the zones resource answer with a 500 and check that the server and tasks groups still work for both clients, and that the view group still reports bind_up 0. They fail without the change.

The zone serials come from the view collector, but both clients fetched the
zones resource on every scrape. With server or tasks as the only enabled
group the extra request was wasted work on servers with many zones, and
any failure of it turned bind_up to 0 and dropped the server metrics too.

Only request the resource when the view group is enabled. The failure
test now enables the groups explicitly, since it relied on the zones
request to fail with no groups at all.

Signed-off-by: vigneshwar <applemacbook6sep2004@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.

1 participant