Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/__redirects
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The table below shows a non-exhaustive list of GraphQL Analytics API fields that
| WAF/L7 Firewall | | US and EU <br/> [`firewallEventsAdaptive`](/analytics/graphql-api/tutorials/querying-firewall-events/) <br/> [`firewallEventsAdaptiveGroups`](https://blog.cloudflare.com/how-we-used-our-new-graphql-api-to-build-firewall-analytics/) <br/> `firewallEventsAdaptiveByTimeGroups` |
| Developer Platform | Cloudflare Images | US only <br/> `imagesRequestsAdaptiveGroups` |
| Cloudflare Pages | | US only <br/> `pagesFunctionsInvocationsAdaptiveGroups` <br/> |
| Durable Objects | | US only <br/> [`durableObjectsInvocationsAdaptiveGroups`](/durable-objects/observability/graphql-analytics/) <br/> [`durableObjectsPeriodicGroups`](/durable-objects/observability/graphql-analytics/) <br/> [`durableObjectsStorageGroups`](/durable-objects/observability/graphql-analytics/) <br/> [`durableObjectsSubrequestsAdaptiveGroups`](/durable-objects/observability/graphql-analytics/) |
| Durable Objects | | US only <br/> [`durableObjectsInvocationsAdaptiveGroups`](/durable-objects/observability/metrics-and-analytics/) <br/> [`durableObjectsPeriodicGroups`](/durable-objects/observability/metrics-and-analytics/) <br/> [`durableObjectsStorageGroups`](/durable-objects/observability/metrics-and-analytics/) <br/> [`durableObjectsSubrequestsAdaptiveGroups`](/durable-objects/observability/metrics-and-analytics/) |
| Email Routing | | US and EU <br/> `emailRoutingAdaptive` <br/> `emailRoutingAdaptiveGroups` |
| R2 | | US and EU <br/> `r2OperationsAdaptiveGroups` <br/> `r2StorageAdaptiveGroups` |
| Stream | | US only <br/> [`streamMinutesViewedAdaptiveGroups`](/stream/getting-analytics/fetching-bulk-analytics/) <br/> [`videoPlaybackEventsAdaptiveGroups`](/stream/getting-analytics/fetching-bulk-analytics/) <br/> [`videoBufferEventsAdaptiveGroups`](/stream/getting-analytics/fetching-bulk-analytics/) <br/> [`videoQualityEventsAdaptiveGroups`](/stream/getting-analytics/fetching-bulk-analytics/) |
Expand Down
Original file line number Diff line number Diff line change
@@ -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";

<GlossaryTooltip term="Durable Object">Durable Objects</GlossaryTooltip> expose analytics for Durable Object namespace-level and request-level metrics.

Expand All @@ -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:

<Steps>
1. In the Cloudflare dashboard, go to the **Durable Objects** page.

<DashButton url="/?to=/:account/workers/durable-objects" />
2. View account-level Durable Objects usage.
3. Select an existing namespace.
3. Select an existing Durable Object namespace.
4. Select the **Metrics** tab.
</Steps>

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:

<Steps>
1. Enable Durable Object logging in the Wrangler configuration file of the Worker that defines your Durable Object class:
<WranglerConfig>
```jsonc
{
"observability": {
"enabled": true
}
}
```
</WranglerConfig>
2. Deploy the latest version of the Worker with the updated binding.
3. Go to the **Durable Objects** page.

<DashButton url="/?to=/:account/workers/durable-objects" />
4. Select an existing Durable Object namespace.
5. Select the **Logs** tab.

</Steps>

:::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.
Expand Down Expand Up @@ -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).
- 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

<Render file="do-faq-metrics-and-analytics" product="durable-objects" />
3 changes: 3 additions & 0 deletions src/content/docs/durable-objects/reference/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ import { Render } from "~/components";

<Render file="do-faq-limits" product="durable-objects"/>

## Metrics and analytics

<Render file="do-faq-metrics-and-analytics" product="durable-objects"/>
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion src/content/release-notes/durable-objects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down