OpenAICloudflare Developer PlatformApr 28, 2026, 12:00 AM

Queues - Realtime backlog metrics now available for Queues

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Queues - Realtime backlog metrics now available for Queues

Key Points

  • Realtime backlog metrics exposed
  • Adds count, bytes, and oldest-message timestamp
  • Accessible via dashboard, REST, and JS APIs

Summary

Cloudflare Queues now exposes realtime backlog metrics across the dashboard, REST API, and JavaScript API. Three new fields provide per-queue visibility into unacknowledged messages and their size/timestamp.

Key Points

  • New realtime fields: backlog_count (number of unacknowledged messages), backlog_bytes (total size in bytes), and oldest_message_timestamp_ms (oldest unacknowledged message timestamp).
  • API and integration surface:
    • REST endpoints returning metadata.metrics after successful consumption:
      • /accounts/{account_id}/queues/{queue_id}/messages/pull
      • /accounts/{account_id}/queues/{queue_id}/messages
      • /accounts/{account_id}/queues/{queue_id}/messages/batch
    • JavaScript: call env.QUEUE.metrics() to fetch realtime metrics; env.QUEUE.send() and env.QUEUE.sendBatch() now include a metrics object on responses.
    • Metrics are also queryable via the GraphQL Analytics API and visible in the dashboard.

Practical notes for engineers

  • Use backlog_count to trigger scaling or alerting when unacknowledged message counts rise.
  • Use backlog_bytes for storage/throughput planning and oldest_message_timestamp_ms to detect processing lag.
  • Example JS return values: { backlogCount, backlogBytes, oldestMessageTimestamp } (types: number, number, Date | undefined).
  • Check metadata.metrics on message consumption responses to get immediate post-consume backlog state.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

Queues — キューのリアルタイムバックログメトリクスが利用可能に

Queues — キューのリアルタイムバックログメトリクスが利用可能に

公開日: 2026-04-28

Cloudflare が提供するマネージドメッセージキュー「Queues」は、ダッシュボード、REST API、JavaScript API を通じてリアルタイムのバックログメトリクスを公開するようになりました。

新しいメトリクスフィールド

以下の3つのフィールドが利用可能です:

  • backlog_count — キュー内の未ack(未確認)メッセージ数
  • backlog_bytes — それらのメッセージの合計サイズ(バイト単位)
  • oldest_message_timestamp_ms — 最も古い未ackメッセージのタイムスタンプ(ミリ秒)

変更されたエンドポイント

メッセージ消費が成功した後、以下のエンドポイントの結果フィールドに metadata.metrics オブジェクトが含まれるようになりました:

  • /accounts/{account_id}/queues/{queue_id}/messages/pull
  • /accounts/{account_id}/queues/{queue_id}/messages
  • /accounts/{account_id}/queues/{queue_id}/messages/batch

JavaScript API

リアルタイムのバックログメトリクスを取得するには env.QUEUE.metrics() を呼び出してください。

TypeScript

const {
  backlogCount, // number
  backlogBytes, // number
  oldestMessageTimestamp, // Date | undefined
} = await env.QUEUE.metrics();

env.QUEUE.send()env.QUEUE.sendBatch() は、レスポンスに metrics オブジェクトを返すようになりました。

これらのフィールドは GraphQL Analytics API からもクエリ可能で、ダッシュボード ↗ でリアルタイムのバックログを確認することもできます。詳細は Queues metrics を参照してください。

Queues - Realtime backlog metrics now available for Queues | Cloudflare Developer Platform | DocsDigest