From e35a2eb38ea42e062c6c95a757e153ce4f6ea7a8 Mon Sep 17 00:00:00 2001 From: daisyfaithauma Date: Thu, 12 Sep 2024 15:29:53 +0100 Subject: [PATCH] Revert "[AIG] Updated logging (#16793)" (#16795) This reverts commit de43b5e27cc69b961df06ad403b3cae7612c196a. --- .../ai-gateway/observability/analytics.mdx | 15 ++++------ .../observability/persistent-logs.mdx | 30 ------------------- src/content/partials/ai-gateway/logging.mdx | 10 ------- 3 files changed, 5 insertions(+), 50 deletions(-) delete mode 100644 src/content/docs/ai-gateway/observability/persistent-logs.mdx delete mode 100644 src/content/partials/ai-gateway/logging.mdx diff --git a/src/content/docs/ai-gateway/observability/analytics.mdx b/src/content/docs/ai-gateway/observability/analytics.mdx index bf533c1aba0dbab..544deb7bd126265 100644 --- a/src/content/docs/ai-gateway/observability/analytics.mdx +++ b/src/content/docs/ai-gateway/observability/analytics.mdx @@ -1,20 +1,11 @@ --- -title: Analytics +title: Analytics and logging pcx_content_type: reference --- import { Render, TabItem, Tabs } from "~/components";
-These analytics help you understand traffic patterns, token consumption, and -potential issues across different AI providers or individual providers. You can -view the following analytics: - -- **Requests**: View the total number of requests processed by the AI Gateway. -- **Token Usage**: Analyze token consumption across all requests, giving insight into usage patterns and helping optimize token allocation. -- **Costs**: Gain visibility into the costs associated with using different AI providers. This allows you to track spending, manage budgets, and optimize your resources. -- **Error Rates**: Monitor the percentage of errors across requests, helping to identify and troubleshoot issues that may arise in provider responses. -- **Cached Responses**: View the percentage of responses served from cache. ## View analytics @@ -48,3 +39,7 @@ curl https://api.cloudflare.com/client/v4/graphql \ The cost metric is an estimation based on the number of tokens sent and received in requests. While this metric can help you monitor and predict cost trends, refer to your provider’s dashboard for the most accurate cost details. ::: + +## Logging + +Your AI Gateway dashboard also shows real-time logs of individual requests, such as the prompt, response, provider, timestamps, and whether the request was successful, cached, or if there was an error. These logs now persist and can store up to 10,000 logs per gateway for better observability and analysis. diff --git a/src/content/docs/ai-gateway/observability/persistent-logs.mdx b/src/content/docs/ai-gateway/observability/persistent-logs.mdx deleted file mode 100644 index 9129bb3f9f1a7de..000000000000000 --- a/src/content/docs/ai-gateway/observability/persistent-logs.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -pcx_content_type: reference -title: Persistent logs(beta) -sidebar: - badge: - text: Beta ---- - -import { Render } from "~/components"; - -Logging is a fundamental building block for application development. Logging provides insights during the early stages of development and is often critical to understanding issues occurring in production. - -Your AI Gateway dashboard shows logs of individual requests, including the user prompt, model response, provider, timestamp, request status, token usage, cost, and duration. These logs persist, giving you the flexibility to store them for your preferred duration and do more with valuable request data. You can store up to 10 million logs per gateway. - -When you are nearing your plan limit, an alert will be displayed in the dashboard. If your limit is reached, new logs will stop being saved. To continue saving logs, you must delete older logs to free up space for new logs. - -To learn more about your plan limits, refer to the [Pricing](/ai-gateway/pricing/) page. - -## Default configuration - -Logs, which include metrics as well as request and response data are enabled by default for each gateway. If you are concerned about privacy or compliance and want to turn log collection off, you can go to settings and opt out of logs. - - - -This logging behavior will be uniformly applied to all requests in the gateway. If you need to modify the logging settings for specific requests, you can override this setting on a per-request basis. - -:::note[Note] - -If you turn off logging and are using Logpush, this will prevent the response and request body from being forwarded through Logpush. -::: diff --git a/src/content/partials/ai-gateway/logging.mdx b/src/content/partials/ai-gateway/logging.mdx deleted file mode 100644 index 192179ae55d37b4..000000000000000 --- a/src/content/partials/ai-gateway/logging.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -{} ---- - -To change the default log configuration in the dashboard: - -1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account. -2. Go to **AI** > **AI Gateway**. -3. Select **Settings**. -4. Change the **Logs** setting to your preference.