Skip to content

Commit ec91d13

Browse files
maheshwaripdcpena
authored andcommitted
Improved queues observability documentation (#21571)
* Improved queues observability documentation * improved casing * fixed typo * Apply suggestions from code review Co-authored-by: Denise Peña <[email protected]> --------- Co-authored-by: Denise Peña <[email protected]>
1 parent aeb3230 commit ec91d13

File tree

1 file changed

+52
-7
lines changed

1 file changed

+52
-7
lines changed

src/content/docs/queues/observability/metrics.mdx

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,64 @@ sidebar:
66

77
---
88

9-
You can view the metrics for a Queue on your account via the [Cloudflare dashboard](https://dash.cloudflare.com). Navigate to **Storage & Databases** > **Queues** > **your Queue** and under the **Metrics** tab you'll be able to view line charts describing the number of messages processed by final outcome, the number of messages in the backlog, and other important indicators.
9+
Queues expose metrics which allow you to measure the queue backlog, consumer concurrency, and message operations.
1010

11-
The metrics displayed in the Cloudflare dashboard charts are all pulled from Cloudflare's GraphQL Analytics API. You can access the metrics programmatically.
11+
The metrics displayed in the [Cloudflare dashboard](https://dash.cloudflare.com/) are queried from Cloudflare’s [GraphQL Analytics API](/analytics/graphql-api/). You can access the metrics [programmatically](#query-via-the-graphql-api) via GraphQL or HTTP client.
1212

13-
The Queues metrics are split across three different nodes under `viewer` > `accounts`. Refer to [Explore the GraphQL schema](/analytics/graphql-api/getting-started/explore-graphql-schema/) to learn how to navigate a GraphQL schema and discover which data are available.
13+
## Metrics
14+
### Backlog
15+
Queues export the below metrics within the `queuesBacklogAdaptiveGroups` dataset.
1416

15-
To learn more about the GraphQL Analytics API, refer to [GraphQL Analytics API](/analytics/graphql-api/).
17+
| Metric | GraphQL Field Name | Description |
18+
| ---------------------- | ------------------------- | ---------------------------------------------------------------|
19+
| Backlog bytes | `bytes` | Average size of the backlog, in bytes |
20+
| Backlog messages | `messages` | Average size of the backlog, in number of messages |
1621

17-
## Write GraphQL queries
22+
The `queuesBacklogAdaptiveGroups` dataset provides the following dimensions for filtering and grouping queries:
23+
* `queueID` - ID of the queue
24+
* `datetime` - Timestamp for when the message was sent
25+
* `date` - Timestamp for when the message was sent, truncated to the start of a day
26+
* `datetimeHour` - Timestamp for when the message was sent, truncated to the start of an hour
27+
* `datetimeMinute` - Timestamp for when the message was sent, truncated to the start of a minute
1828

19-
Examples of how to explore your Queues metrics.
29+
### Consumer concurrency
30+
Queues export the below metrics within the `queueConsumerMetricsAdaptiveGroups` dataset.
2031

21-
### Get average Queue backlog over time period
32+
| Metric | GraphQL Field Name | Description |
33+
| ---------------------- | ------------------------- | --------------------------------------------------------------- |
34+
| Avg. Consumer Concurrency | `concurrency` | Average number of concurrent consumers over the period |
35+
36+
The `queueConsumerMetricsAdaptiveGroups` dataset provides the following dimensions for filtering and grouping queries:
37+
* `queueID` - ID of the queue
38+
* `datetime` - Timestamp for the consumer metrics
39+
* `date` - Timestamp for the consumer metrics, truncated to the start of a day
40+
* `datetimeHour` - Timestamp for the consumer metrics, truncated to the start of an hour
41+
* `datetimeMinute` - Timestamp for the consumer metrics, truncated to the start of a minute
42+
43+
### Message operations
44+
Queues export the below metrics within the `queueMessageOperationsAdaptiveGroups` dataset.
45+
46+
| Metric | GraphQL Field Name | Description |
47+
| ---------------------- | ------------------------- | --------------------------------------------------------------- |
48+
| Total billable operations | `billableOperations` | Sum of billable operations (writes, reads, and deletes) over the time period |
49+
| Total Bytes | `bytes` | Sum of bytes read, written, and deleted from the queue |
50+
| Lag | `lagTime` | Average lag time in milliseconds between when the message was written and the operation to consume the message. |
51+
| Retries | `retryCount` | Average number of retries per message |
52+
| Message Size | `messageSize` | Maximum message size over the specified period |
53+
54+
The `queueMessageOperationsAdaptiveGroups` dataset provides the following dimensions for filtering and grouping queries:
55+
* `queueID` - ID of the queue
56+
* `actionType` - The type of message operation. Can be `WriteMessage`, `ReadMessage` or `DeleteMessage`
57+
* `consumerType` - The queue consumer type. Can be `worker` or `http`. Only applicable for `ReadMessage` and `DeleteMessage` action types
58+
* `outcome` - The outcome of the mesage operation. Only applicable for `DeleteMessage` action types. Can be `success`, `dlq` or `fail`.
59+
* `datetime` - Timestamp for the message operation
60+
* `date` - Timestamp for the message operation, truncated to the start of a day
61+
* `datetimeHour` - Timestamp for the message operation, truncated to the start of an hour
62+
* `datetimeMinute` - Timestamp for the message operation, truncated to the start of a minute
63+
64+
## Example GraphQL Queries
65+
66+
### Get average queue backlog over time period
2267

2368
```graphql
2469
query QueueBacklog($accountTag: string!, $queueId: string!, $datetimeStart: Time!, $datetimeEnd: Time!) {

0 commit comments

Comments
 (0)