diff --git a/public/__redirects b/public/__redirects index 1f33479d21853cb..f2d215861328603 100644 --- a/public/__redirects +++ b/public/__redirects @@ -549,6 +549,7 @@ /durable-objects/get-started/video-series/ /durable-objects/video-tutorials/ 301 /durable-objects/what-are-durable-objects/ /durable-objects/concepts/what-are-durable-objects/ 301 +/durable-objects/observability/graphql-analytics/ /durable-objects/observability/metrics-and-analytics/ 301 # email-routing /email-routing/enable-email-routing/ /email-routing/get-started/enable-email-routing/ 301 diff --git a/src/content/docs/data-localization/metadata-boundary/graphql-datasets.mdx b/src/content/docs/data-localization/metadata-boundary/graphql-datasets.mdx index 2517f103ff06efe..8f53ce990b09f24 100644 --- a/src/content/docs/data-localization/metadata-boundary/graphql-datasets.mdx +++ b/src/content/docs/data-localization/metadata-boundary/graphql-datasets.mdx @@ -33,7 +33,7 @@ The table below shows a non-exhaustive list of GraphQL Analytics API fields that | WAF/L7 Firewall | | US and EU
[`firewallEventsAdaptive`](/analytics/graphql-api/tutorials/querying-firewall-events/)
[`firewallEventsAdaptiveGroups`](https://blog.cloudflare.com/how-we-used-our-new-graphql-api-to-build-firewall-analytics/)
`firewallEventsAdaptiveByTimeGroups` | | Developer Platform | Cloudflare Images | US only
`imagesRequestsAdaptiveGroups` | | Cloudflare Pages | | US only
`pagesFunctionsInvocationsAdaptiveGroups`
| -| Durable Objects | | US only
[`durableObjectsInvocationsAdaptiveGroups`](/durable-objects/observability/graphql-analytics/)
[`durableObjectsPeriodicGroups`](/durable-objects/observability/graphql-analytics/)
[`durableObjectsStorageGroups`](/durable-objects/observability/graphql-analytics/)
[`durableObjectsSubrequestsAdaptiveGroups`](/durable-objects/observability/graphql-analytics/) | +| Durable Objects | | US only
[`durableObjectsInvocationsAdaptiveGroups`](/durable-objects/observability/metrics-and-analytics/)
[`durableObjectsPeriodicGroups`](/durable-objects/observability/metrics-and-analytics/)
[`durableObjectsStorageGroups`](/durable-objects/observability/metrics-and-analytics/)
[`durableObjectsSubrequestsAdaptiveGroups`](/durable-objects/observability/metrics-and-analytics/) | | Email Routing | | US and EU
`emailRoutingAdaptive`
`emailRoutingAdaptiveGroups` | | R2 | | US and EU
`r2OperationsAdaptiveGroups`
`r2StorageAdaptiveGroups` | | Stream | | US only
[`streamMinutesViewedAdaptiveGroups`](/stream/getting-analytics/fetching-bulk-analytics/)
[`videoPlaybackEventsAdaptiveGroups`](/stream/getting-analytics/fetching-bulk-analytics/)
[`videoBufferEventsAdaptiveGroups`](/stream/getting-analytics/fetching-bulk-analytics/)
[`videoQualityEventsAdaptiveGroups`](/stream/getting-analytics/fetching-bulk-analytics/) | diff --git a/src/content/docs/durable-objects/observability/graphql-analytics.mdx b/src/content/docs/durable-objects/observability/metrics-and-analytics.mdx similarity index 75% rename from src/content/docs/durable-objects/observability/graphql-analytics.mdx rename to src/content/docs/durable-objects/observability/metrics-and-analytics.mdx index 3f69594a1216eba..6505f1dc10fa018 100644 --- a/src/content/docs/durable-objects/observability/graphql-analytics.mdx +++ b/src/content/docs/durable-objects/observability/metrics-and-analytics.mdx @@ -1,12 +1,12 @@ --- -title: Metrics and GraphQL analytics +title: Metrics and analytics pcx_content_type: concept sidebar: order: 6 --- -import { GlossaryTooltip, DashButton } from "~/components"; +import { GlossaryTooltip, DashButton, Steps, WranglerConfig, Render } from "~/components"; Durable Objects expose analytics for Durable Object namespace-level and request-level metrics. @@ -17,19 +17,51 @@ The metrics displayed in the [Cloudflare dashboard](https://dash.cloudflare.com/ A Durable Object namespace is a set of Durable Objects that can be addressed by name, backed by the same class. There is only one Durable Object namespace per class. A Durable Object namespace can contain any number of Durable Objects. ::: -## View metrics and analytics via the dashboard +## View metrics and analytics Per-namespace analytics for Durable Objects are available in the Cloudflare dashboard. To view current and historical metrics for a namespace: + 1. In the Cloudflare dashboard, go to the **Durable Objects** page. 2. View account-level Durable Objects usage. -3. Select an existing namespace. +3. Select an existing Durable Object namespace. 4. Select the **Metrics** tab. + You can optionally select a time window to query. This defaults to the last 24 hours. +## View logs + +You can view Durable Object logs from the Cloudflare dashboard. Logs are aggregated by the script name and the Durable Object class name. + +To start using Durable Object logging: + + +1. Enable Durable Object logging in the Wrangler configuration file of the Worker that defines your Durable Object class: + + ```jsonc + { + "observability": { + "enabled": true + } + } + ``` + +2. Deploy the latest version of the Worker with the updated binding. +3. Go to the **Durable Objects** page. + + +4. Select an existing Durable Object namespace. +5. Select the **Logs** tab. + + + +:::note +For information on log limits (such as maximum log retention period), refer to the [Workers Logs documentation](/workers/observability/logs/workers-logs/#limits). +::: + ## Query via the GraphQL API Durable Object metrics are powered by GraphQL. @@ -85,4 +117,8 @@ Refer to the [Querying Workers Metrics with GraphQL](/analytics/graphql-api/tuto ## Additional resources -- For instructions on setting up a Grafana dashboard to query Cloudflare's GraphQL Analytics API, refer to [Grafana Dashboard starter for Durable Object metrics](https://github.com/TimoWilhelm/grafana-do-dashboard). \ No newline at end of file +- For instructions on setting up a Grafana dashboard to query Cloudflare's GraphQL Analytics API, refer to [Grafana Dashboard starter for Durable Object metrics](https://github.com/TimoWilhelm/grafana-do-dashboard). + +## FAQs + + \ No newline at end of file diff --git a/src/content/docs/durable-objects/reference/faq.mdx b/src/content/docs/durable-objects/reference/faq.mdx index b3a0b399fed7b55..c0dbcf241d053be 100644 --- a/src/content/docs/durable-objects/reference/faq.mdx +++ b/src/content/docs/durable-objects/reference/faq.mdx @@ -16,3 +16,6 @@ import { Render } from "~/components"; +## Metrics and analytics + + \ No newline at end of file diff --git a/src/content/partials/durable-objects/do-faq-metrics-and-analytics.mdx b/src/content/partials/durable-objects/do-faq-metrics-and-analytics.mdx new file mode 100644 index 000000000000000..ea25a405ba4567b --- /dev/null +++ b/src/content/partials/durable-objects/do-faq-metrics-and-analytics.mdx @@ -0,0 +1,9 @@ +--- +{} +--- + +import {GlossaryTooltip, WranglerConfig} from "~/components"; + +### How can I identify which Durable Object instance generated a log entry? + +You can use `$workers.durableObjectId` to identify the specific Durable Object instance that generated the log entry. \ No newline at end of file diff --git a/src/content/release-notes/durable-objects.yaml b/src/content/release-notes/durable-objects.yaml index bcae9dce5e6bd90..e99a25da99b9818 100644 --- a/src/content/release-notes/durable-objects.yaml +++ b/src/content/release-notes/durable-objects.yaml @@ -69,7 +69,7 @@ entries: description: |- Durable Objects [request billing](/durable-objects/platform/pricing/#billing-metrics) applies a 20:1 ratio for incoming WebSocket messages. For example, 1 million Websocket received messages across connections would be charged as 50,000 Durable Objects requests. - This is a billing-only calculation and does not impact Durable Objects [metrics and analytics](/durable-objects/observability/graphql-analytics/). + This is a billing-only calculation and does not impact Durable Objects [metrics and analytics](/durable-objects/observability/metrics-and-analytics/). - publish_date: "2024-02-15" title: Optional `alarmInfo` parameter for Durable Object Alarms