Skip to content

Metrics Dashboard

Temp edited this page Feb 11, 2026 · 3 revisions

Metrics Dashboard

The Metrics Dashboard provides comprehensive analytics for your R2 buckets, powered by the Cloudflare GraphQL Analytics API.

Overview

The Metrics Dashboard features a tabbed interface with two views:

Overview Tab

  • 📊 Total Operations - Read and write operations across all buckets
  • 💾 Total Storage - Combined storage size across buckets
  • 📈 Class A/B Operations - Breakdown by operation class
  • 📊 Operations Chart - Request volume over time
  • 📋 Per-Bucket Breakdown - Detailed metrics for each bucket

Storage Tab

  • 📈 Storage Trend - Total storage usage over time
  • 📦 Object Count Trend - Number of objects over time
  • 📊 Storage by Bucket - Distribution chart across buckets
  • 📋 Storage Details Table - Per-bucket breakdown with percentages

Accessing the Dashboard

  1. Click the Metrics tab in the main navigation
  2. Select a time range (24h, 7d, or 30d)
  3. View summary cards and trend charts

Dashboard Components

Summary Cards

Four cards at the top provide key metrics at a glance:

Card Description
Total Requests Combined read/write operations
Success Rate Percentage of successful requests
Total Storage Combined payload size for all buckets
Object Count Total objects across all buckets

Time Range Selector

Choose the time range for your metrics:

Range Description Best For
Last 24 Hours Recent activity Real-time monitoring
Last 7 Days Weekly trends Weekly planning
Last 30 Days Monthly overview Monthly billing review

Bucket Filter

Filter metrics by a specific bucket:

  • Select a bucket from the dropdown to see metrics for that bucket only
  • Select "All Buckets" to see aggregate metrics across all buckets
  • Filtered views work with both Overview and Storage tabs

Requests Chart

An SVG-based line chart showing:

  • Request volume over time
  • Hover over data points to see exact values and timestamps

Requests by Bucket

Horizontal bar chart showing which buckets have the most activity:

  • Top 10 buckets by request count
  • Visual comparison of bucket usage

Storage by Bucket

Horizontal bar chart showing storage distribution:

  • Top 10 buckets by payload size
  • Helps identify storage optimization opportunities

Per-Bucket Breakdown Table

A sortable table with columns for:

  • Bucket name
  • Total requests
  • Successful requests
  • Error count
  • Object count
  • Storage size

Caching

The Metrics Dashboard uses client-side caching for performance:

  • Cache Duration: 2 minutes per time range
  • Cache Key: Time range (24h, 7d, 30d)
  • Refresh: Click the refresh button to bypass cache

The 2-minute TTL reflects the dynamic nature of metrics data while avoiding excessive API calls.

API Reference

Get Metrics

GET /api/metrics?range=24h|7d|30d

Query Parameters:

Parameter Type Default Description
range string 7d Time range: 24h, 7d, or 30d

Response:

{
  "success": true,
  "result": {
    "summary": {
      "timeRange": "7d",
      "startDate": "2025-12-01",
      "endDate": "2025-12-07",
      "totalRequests": 125000,
      "successfulRequests": 120000,
      "errorRequests": 5000,
      "totalStorageBytes": 52428800,
      "totalObjectCount": 1500,
      "bucketCount": 5
    },
    "byBucket": [...],
    "operationsSeries": [...],
    "storageSeries": [...]
  }
}

Understanding the Metrics

Request Volume

  • Success: Operations that completed successfully
  • Errors: Operations that failed (userError or internalError)
  • Monitor for sudden spikes in errors

Storage Usage

Storage includes:

  • Payload data (actual file content)
  • Metadata (headers, custom metadata)

R2 storage is charged per GB, so monitor growth over time.

API Token Requirements

Important

Your Cloudflare API token must have the Analytics permission scope to query the GraphQL Analytics API. If you see "Failed to fetch metrics" errors, verify your token includes this permission.

Accessibility

The Metrics Dashboard is designed with accessibility in mind:

  • Screen Reader Support: ARIA labels on all interactive elements
  • Keyboard Navigation: Full keyboard accessibility
  • Color Contrast: WCAG-compliant colors for charts
  • Text Alternatives: Data tables available alongside charts

Troubleshooting

"Failed to load metrics"

Causes:

  • GraphQL API temporarily unavailable
  • Invalid time range parameter
  • API token missing Analytics permission

Solutions:

  1. Try refreshing the page
  2. Check Cloudflare status page
  3. Verify API token has Analytics permission

Metrics Not Updating

Causes:

  • Data is cached (2 minute TTL)
  • GraphQL API delay (up to 5 minutes)

Solutions:

  1. Click the refresh button
  2. Wait a few minutes for data propagation

Missing Buckets

Causes:

  • Bucket has no activity in selected time range
  • Bucket was just created

Solutions:

  1. Try a longer time range
  2. Perform an operation on the bucket to generate activity

Related Documentation


Need Help? See Troubleshooting or open an issue.

R2 Bucket Manager Wiki

Getting Started

Core Features

Development

Security & Authentication

Support & Resources

External Links

Clone this wiki locally