From 26f0536139cb08e07331ce0145199e1061e95da8 Mon Sep 17 00:00:00 2001 From: Cyb3r-Jak3 Date: Thu, 1 Aug 2024 18:22:23 -0400 Subject: [PATCH] docs: Add new metrics to README --- README.md | 5 +++++ cloudflare.go | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a48a41..ed22b03 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ Required authentication scopes: To authenticate this way, only set `CF_API_TOKEN` (omit `CF_API_EMAIL` and `CF_API_KEY`) +[Shortcut to create the API token](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_analytics%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22analytics%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22firewall_services%22%2C%22type%22%3A%22read%22%7D%5D&name=Cloudflare+Exporter&accountId=*&zoneId=all) + ### User email + API key To authenticate with user email + API key, use the `Global API Key` from the Cloudflare dashboard. Beware that this key authenticates with write access to every Cloudflare resource. @@ -104,6 +106,9 @@ Note: `ZONE_` configuration is not supported as flag. # HELP cloudflare_zone_pool_requests_total Requests per pool # HELP cloudflare_logpush_failed_jobs_account_count Number of failed logpush jobs on the account level # HELP cloudflare_logpush_failed_jobs_zone_count Number of failed logpush jobs on the zone level +# HELP cloudflare_r2_operation_count Number of operations performed by R2 +# HELP cloudflare_r2_storage_bytes Storage used by R2 +# HELP cloudflare_r2_storage_total_bytes Total storage used by R2 ``` ## Helm chart repository diff --git a/cloudflare.go b/cloudflare.go index 11dece9..3f054f6 100644 --- a/cloudflare.go +++ b/cloudflare.go @@ -758,7 +758,6 @@ func fetchR2Account(accountID string) (*cloudflareResponseR2Account, error) { now := time.Now().Add(-time.Duration(viper.GetInt("scrape_delay")) * time.Second).UTC() s := 60 * time.Second now = now.Truncate(s) - now1mAgo := now.Add(-60 * time.Second) request := graphql.NewRequest(`query($accountID: String!, $limit: Int!, $date: String!) { viewer {