-
Notifications
You must be signed in to change notification settings - Fork 15
Metrics Dashboard
The Metrics Dashboard provides comprehensive analytics for your R2 buckets, powered by the Cloudflare GraphQL Analytics API.
The Metrics Dashboard features a tabbed interface with two views:
- 📊 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 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
- Click the Metrics tab in the main navigation
- Select a time range (24h, 7d, or 30d)
- View summary cards and trend charts
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 |
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 |
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
An SVG-based line chart showing:
- Request volume over time
- Hover over data points to see exact values and timestamps
Horizontal bar chart showing which buckets have the most activity:
- Top 10 buckets by request count
- Visual comparison of bucket usage
Horizontal bar chart showing storage distribution:
- Top 10 buckets by payload size
- Helps identify storage optimization opportunities
A sortable table with columns for:
- Bucket name
- Total requests
- Successful requests
- Error count
- Object count
- Storage size
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.
GET /api/metrics?range=24h|7d|30dQuery 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": [...]
}
}- Success: Operations that completed successfully
- Errors: Operations that failed (userError or internalError)
- Monitor for sudden spikes in errors
Storage includes:
- Payload data (actual file content)
- Metadata (headers, custom metadata)
R2 storage is charged per GB, so monitor growth over time.
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.
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
Causes:
- GraphQL API temporarily unavailable
- Invalid time range parameter
- API token missing Analytics permission
Solutions:
- Try refreshing the page
- Check Cloudflare status page
- Verify API token has Analytics permission
Causes:
- Data is cached (2 minute TTL)
- GraphQL API delay (up to 5 minutes)
Solutions:
- Click the refresh button
- Wait a few minutes for data propagation
Causes:
- Bucket has no activity in selected time range
- Bucket was just created
Solutions:
- Try a longer time range
- Perform an operation on the bucket to generate activity
- Job-History - Track all operations
- API-Reference - Complete API documentation
- Troubleshooting - General troubleshooting guide
Need Help? See Troubleshooting or open an issue.
- Home - Documentation overview
- Quick Start Guide - Get up and running in minutes
- Installation & Setup - Complete deployment guide
- Configuration Reference - Environment variables and settings
- Upgrade Guide - Database schema migrations
- Bucket Management - Create, rename, delete buckets
- Object Lifecycles - Automate expiration and IA transitions ⭐ NEW
- Local Uploads - Faster uploads via nearby edge storage ⭐ NEW
- Job History - Track bulk operations with audit trail ⭐ NEW
- Webhooks - Configure HTTP notifications for events ⭐ NEW
- AI Search - Semantic search with Cloudflare AI
- S3 Import - Migrate from AWS S3 to R2 ⭐ NEW
- Cross-Bucket Search - Search across all buckets with filters
- File Operations - Upload, download, move, copy, delete files
- Folder Management - Organize files hierarchically
- Signed URLs & Sharing - Generate secure shareable links
- Advanced Filtering - Filter by extension, size, and date
- Development Guide - Local setup and development workflow
- API Reference - Complete endpoint documentation
- Architecture Overview - Technical stack and design
- Authentication & Security - Zero Trust implementation
- JWT Validation - JWT token validation and verification
- Troubleshooting - Common issues and solutions
- FAQ - Frequently asked questions
- Roadmap - Planned features and enhancements