Introduce requests per LB pool metric & fix LB pool health status metric #65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the following changes:
fix: Report LB pool health properly
The
cloudflare_zone_pool_health_status
metric introduced with goalto report the actual pools health status during the time, regardless
if this pool is the selected one or not. The initial implementation
uses the
loadBalancingRequestsAdaptiveGroups
type which returnsaggregated Load Balancing origin requests with adaptive sampling and
contains information only about the selectedPool (Name, Health,
AvgRttMs, etc), rather than for all LB pools. This leads on reporthing
back the status only of the selectedPool (which normally is always 1)
and not the overall status of all LB's pools.
According to Cloudflare's documentation about LoadBalancing GraphQL
Analytics API[1], the
loadBalancingRequestsAdaptive
schema can beused to fetch analytics about the Raw Load Balancing origin requests
with adaptive sampling. These analytics exposes infromation about the
selected pool like:
But it also exposes information about LB's pools and origins regardless
the selection decision, like:
The latter metrics can be used to report the health of all pools
associated with account's LBs.
For this reason, this commit adds the required
loadBalancingRequestsAdaptive
schema struct on the lbResp struct and configures it as the source for the
cloudflare_zone_pool_health_status
metric.feat: Add poolRequestsTotal metric
This commit introduces a prometheus counter metric about the total
number of requests per pool.