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

Add path metric #90

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

yurifrlcw
Copy link

@yurifrlcw yurifrlcw commented Mar 14, 2023

New Cloudflare metric and configuration option

This pull request adds a new metric, cloudflare_zone_requests_origin_status_path_host, to the exporter. The new metric takes the path from Cloudflare's GraphQL endpoint httpRequestsAdaptiveGroups.

To enable this new metric, a new configuration option cfgClientRequestPathFilters has been added, which allows the user to pass a filter to specify which requests should be included in the metric. For example, to filter requests based on their HTTP host and path, the following command line argument can be used:

-cf_path_filters='{ "AND": [ { "clientRequestHTTPHost_in": [ "foo.io" ] }, {"clientRequestPath_in": [ "/bar", "/bar/foo" ] } ] }'

The filter should match the filter of httpRequestsAdaptiveGroups and the default datetime will be added

This filter will only include requests that have an HTTP host of foo.io and a path of either /bar or /bar/foo.

This new feature provides users of cloudflare-exporter with greater flexibility in monitoring and analyzing requests from specific origins.

Notes

  • This should address [Feature request] Add paths  #33
  • I choose this approach to not flood prometheus with metrics, I noticed that even if I get the top x metrics, this number tend to grown as they rotate, found much safer to just pass the query and give the option to use filters like clientRequestPath_in

@Cali93
Copy link

Cali93 commented Jun 5, 2024

Hey, nice one. Curious what's left here to get it merged ?

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.

2 participants