Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce requests per LB pool metric & fix LB pool health status metric #65

Merged
merged 2 commits into from
Jul 24, 2022

Conversation

axilleastr
Copy link
Contributor

This PR introduces the following changes:

  • fix: Report LB pool health properly

    The cloudflare_zone_pool_health_status metric introduced with goal
    to 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 returns
    aggregated 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 be
    used to fetch analytics about the Raw Load Balancing origin requests
    with adaptive sampling. These analytics exposes infromation about the
    selected pool like:

    • Selected Pool - Name/Health/ID/Average RTT
    • Session Affinity - Type/Status

    But it also exposes information about LB's pools and origins regardless
    the selection decision, like:

    • Pools ID/Name/Health/Average RTT/Selected
    • Origins Name/FQDN/Ipv4/Ipv6/Selected

    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.

    1. https://developers.cloudflare.com/load-balancing/reference/load-balancing-analytics/#graphql-analytics
  • feat: Add poolRequestsTotal metric

    This commit introduces a prometheus counter metric about the total
    number of requests per pool.

axilleastr added 2 commits May 6, 2022 00:10
The `cloudflare_zone_pool_health_status` metric introduced with goal
to 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 returns
aggregated 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 be
used to fetch analytics about the Raw Load Balancing origin requests
with adaptive sampling. These analytics exposes infromation about the
selected pool like:
* Selected Pool - Name/Health/ID/Average RTT
* Session Affinity - Type/Status
But it also exposes information about LB's pools and origins regardless
the selection decision, like:
* Pools ID/Name/Health/Average RTT/Selected
* Origins Name/FQDN/Ipv4/Ipv6/Selected
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.

1. https://developers.cloudflare.com/load-balancing/reference/load-balancing-analytics/#graphql-analytics
This commit introduces a prometheus counter metric about the total
number of requests per pool.
@axilleastr
Copy link
Contributor Author

hello, @martinhaus :) I would appreciate a review when you have some time :)
Thanks in advance!

@axilleastr
Copy link
Contributor Author

Hey @martinhaus, I was wondering if you could help with this PR.

@michaelsilver
Copy link

Hey @martinhaus, any updates on this PR?

@martinhaus
Copy link
Member

LGTM, sorry for the late response

@martinhaus martinhaus merged commit b6871aa into lablabs:master Jul 24, 2022
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.

3 participants