Metrics and GraphQL analytics
Durable Objects expose analytics for Durable Object namespace-level and request-level metrics.
The metrics displayed in the Cloudflare dashboard ↗ charts are queried from Cloudflare’s GraphQL Analytics API. You can access the metrics programmatically via GraphQL or HTTP client.
View metrics and analytics via the dashboard
Per-namespace analytics for Durable Objects are available in the Cloudflare dashboard. To view current and historical metrics for a namespace:
- Log in to the Cloudflare dashboard ↗ and select your account.
- Go to Workers & Pages > Durable Objects ↗.
- View account-level Durable Objects usage.
- Select an existing namespace.
- Select the Metrics tab.
You can optionally select a time window to query. This defaults to the last 24 hours.
Query via the GraphQL API
Durable Object metrics are powered by GraphQL.
The datasets that include Durable Object metrics include:
durableObjectsInvocationsAdaptiveGroups
durableObjectsPeriodicGroups
durableObjectsStorageGroups
durableObjectsSubrequestsAdaptiveGroups
Use GraphQL Introspection to get information on the fields exposed by each datasets.
WebSocket metrics
Durable Objects using WebSockets will see request metrics across several GraphQL datasets because WebSockets have different types of requests.
- Metrics for a WebSocket connection itself is represented in
durableObjectsInvocationsAdaptiveGroups
once the connection closes. Since WebSocket connections are long-lived, connections often do not terminate until the Durable Object terminates. - Metrics for incoming and outgoing WebSocket messages on a WebSocket connection are available in
durableObjectsPeriodicGroups
. If a WebSocket connection uses WebSocket Hibernation, incoming WebSocket messages are instead represented indurableObjectsInvocationsAdaptiveGroups
.
Example GraphQL query for Durable Objects
Refer to the Querying Workers Metrics with GraphQL tutorial for authentication and to learn more about querying Workers datasets.