You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Realtime backlog metrics now available for Queues
3
+
description: Cloudflare Queues metrics now include realtime backlog size (in count & bytes) and oldest message timestamp
4
+
products:
5
+
- queues
6
+
date: 2026-04-10
7
+
---
8
+
9
+
[Queues](/queues/), Cloudflare's managed message queue, now exposes realtime backlog metrics via the dashboard, REST API, and JavaScript API. Three new fields are available:
10
+
11
+
-**`backlog_count`** — the number of unacknowledged messages in the queue
12
+
-**`backlog_bytes`** — the total size of those messages in bytes
13
+
-**`oldest_message_timestamp`** — the timestamp of the oldest unacknowledged message, useful for calculating how far behind your consumers are
14
+
15
+
The following endpoints also now include a `metadata.metrics` object on the result field after successful message consumption:
* Sends a message to the Queue. The body can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#supported_types), as long as its size is less than 128 KB.
105
106
* When the promise resolves, the message is confirmed to be written to disk.
107
+
* Returns a [QueueSendResult](#queuesendresult) containing realtime metrics about the queue.
* Sends a batch of messages to the Queue. Each item in the provided [Iterable](https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html) must be supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#supported_types). A batch can contain up to 100 messages, though items are limited to 128 KB each, and the total size of the array cannot exceed 256 KB.
110
112
* The optional `options` parameter can be used to apply settings (such as `delaySeconds`) to all messages in the batch. See [QueueSendBatchOptions](#queuesendbatchoptions).
111
113
* When the promise resolves, the messages are confirmed to be written to disk.
112
114
115
+
*`metrics()` <Typetext="Promise<QueueMetrics>" />
116
+
117
+
* Returns realtime [QueueMetrics](#queuemetrics) for the queue.
113
118
114
119
115
120
### `MessageSendRequest`
@@ -191,6 +196,54 @@ The default content type for Queues changed to `json` (from `v8`) to improve com
191
196
192
197
If you specify an invalid content type, or if your specified content type does not match the message content's type, the send operation will fail with an error.
193
198
199
+
### `QueueSendResult`
200
+
201
+
The result of a successful send operation.
202
+
203
+
```ts
204
+
interfaceQueueSendResult {
205
+
metadata: {
206
+
metrics:QueueMetrics;
207
+
};
208
+
}
209
+
```
210
+
211
+
212
+
213
+
* <code>metadata</code> <Typetext="object" />
214
+
215
+
* Contains metadata about the queue after the send operation.
Copy file name to clipboardExpand all lines: src/content/docs/queues/observability/metrics.mdx
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,20 @@ The `queueMessageOperationsAdaptiveGroups` dataset provides the following dimens
67
67
-`datetimeHour` - Timestamp for the message operation, truncated to the start of an hour
68
68
-`datetimeMinute` - Timestamp for the message operation, truncated to the start of a minute
69
69
70
+
### Realtime backlog
71
+
72
+
You can access realtime backlog metrics via the [Queues REST API](/api/resources/queues/) and [JavaScript API](/queues/configuration/javascript-apis/). These metrics provide point-in-time values rather than aggregated data.
0 commit comments