Effective today, K2 streams can be inspected directly in the Cloudflare dashboard and via the GraphQL Analytics API. The addition surfaces production throughput, storage volume, and subscription lag without leaving the console, and the same signals are queryable programmatically. Practitioners who need to keep streaming pipelines healthy now have a built‑in observability layer.
Dashboard Views
The K2 Streams page presents three distinct panels:
- Overview – Shows the last five minutes of produce and consume rates, total stored bytes, and per‑subscription lag metrics such as records behind, oldest unread record, and hourly lag.
- Metrics – Provides time‑range charts for bytes produced by each input type (HTTP or binding), total bytes stored, and bytes delivered per subscription.
- Subscription page – Focuses on a single subscription, displaying its current backlog, oldest unread record, consume rate, and dedicated lag and throughput charts.
All panels update automatically, giving operators a quick health check before digging into logs or custom instrumentation.
GraphQL Analytics Datasets
The same signals are available through four beta datasets in the GraphQL Analytics API:
k2ProduceAdaptiveGroups– Bytes produced, broken out by input source.k2ConsumeAdaptiveGroups– Bytes delivered to each subscription.k2StorageAdaptiveGroups– Approximate stored byte count, sampled roughly every ten minutes.k2SubscriptionLagAdaptiveGroups– Number of uncommitted records and age of the oldest pending record (milliseconds).
A typical query pulls five‑minute buckets of production data and the current lag for a given subscription. The time window must span the stream’s retention period (seven days) to capture full lag history.
query K2StreamMetrics {
viewer {
accounts(filter: {accountTag: "<ACCOUNT_ID>"}) {
produced: k2ProduceAdaptiveGroups(
limit: 100,
filter: {
streamId: "<STREAM_ID>",
datetime_geq: "2026-11-23T11:00:00Z",
datetime_lt: "2026-11-23T12:00:00Z"
},
orderBy: [datetimeFiveMinutes_ASC]
) {
dimensions { input datetimeFiveMinutes }
sum { bytes }
}
lag: k2SubscriptionLagAdaptiveGroups(
limit: 1,
filter: {streamId: "<STREAM_ID>", subscriptionId: "<SUBSCRIPTION_ID>"}
) {
dimensions { datetimeFiveMinutes }
sum { records, ageMs }
}
}
}
}
Operational Considerations
With metrics now visible, teams can set up alerts on production spikes, storage thresholds, or subscription lag exceeding expected bounds. Because storage metrics are sampled every ten minutes, alerts should tolerate short‑term variance. When querying lag, ensure the time range covers the full retention window; otherwise, older unprocessed records will be omitted, leading to under‑reporting of backlog.
Capacity planning can be driven by the produce‑by‑input breakdown, allowing engineers to decide whether HTTP ingestion or binding‑based producers need scaling. The subscription‑level charts help identify slow consumers that may require additional workers or back‑pressure handling.
Security and Access
Access to the new dashboard panels follows the existing K2 permissions model; no extra IAM constructs are introduced. The GraphQL API inherits the same authentication requirements as other analytics endpoints, so existing token scopes remain sufficient. Practitioners should verify that only authorized roles can query the beta datasets, especially if lag data could reveal processing delays that are sensitive to business operations.
Related CloudNinjas coverage: hands-on guides.
What This Means For Practitioners
- Incorporate the dashboard panels into daily health checks to catch production or consumption anomalies early.
- Leverage the GraphQL datasets for automated reporting, alerting, or integration with external observability stacks.
- Align alert thresholds with the sampling granularity (five‑minute buckets for produce/consume, ten‑minute for storage) to avoid false positives.
- Review role assignments for the analytics API to ensure only intended personnel can view stream performance data.
- Plan for the upcoming retention period limits when designing subscription lag monitoring; a full‑window query is required for accurate backlog sizing.
