Skip to content

Metrics

Chris edited this page Jul 26, 2026 · 5 revisions

Metrics

Drive data-backed decisions with our comprehensive Metrics Dashboard. Gain real-time analytics and actionable performance insights for your Cloudflare KV namespaces, seamlessly powered by Cloudflare's GraphQL Analytics API.

Accessing Metrics

Click the Metrics tab in the main navigation (between Search and Job History) to view the metrics dashboard.

Tabbed Interface

Operations Tab

View operational metrics including read/write counts and latency:

Summary Cards:

  • Total Operations: Combined count of all KV operations
  • Reads: Total read operations with percentage
  • Writes: Total write operations with percentage
  • Namespaces: Count of namespaces with activity

Operations Breakdown: Visual progress bars showing distribution by type:

  • Read (blue)
  • Write (green)
  • Delete (red)
  • List (purple)

Average Latency: Aggregated latency percentiles across all operations:

  • P50: Median latency
  • P90: 90th percentile
  • P99: 99th percentile

Storage Tab

View storage metrics per namespace:

Summary Cards:

  • Total Keys: Aggregate key count across all namespaces (with trend indicator)
  • Total Storage: Combined storage size in human-readable format (with trend indicator)
  • Data Points: Number of storage records collected

Storage by Namespace: Sortable table showing per-namespace breakdown:

  • Namespace name
  • Key count
  • Storage size
  • Click rows to expand and view namespace ID and operation counts

Trend Indicators: Green/red arrows show storage growth or decline over the selected time period.

Filters

Namespace Filter

Select a specific namespace or choose "All Namespaces" for account-wide metrics.

Time Range

  • Last 24 hours
  • Last 7 days (default)
  • Last 30 days

Note: Cloudflare's GraphQL Analytics API retains KV metrics for up to 31 days.

Scheduled Threshold Monitoring

KV Manager facilitates a transition from passive observation to proactive system management. You can configure automated, scheduled checks that monitor metrics against your defined limits.

  • Execution Schedule: Runs automatically on an hourly cron trigger.
  • Data Source: Powered by the Cloudflare GraphQL Analytics API.
  • Usage Penalty: Note that scheduled monitoring queries incur regular Analytics API usage.
  • Configuration: Configure thresholds directly in the UI for storage bytes, operation rates, and P99 latency.
  • Alerts: Trigger webhook alerts automatically when limits are exceeded.
  • Audit Logging: All threshold breaches and monitoring events are recorded in the Audit Log.

See the Namespace configuration for how to link this to your monitoring workflows.

Caching & Refresh

  • Metrics data is cached for 2 minutes to reduce API calls
  • Click Refresh to bypass cache and fetch the latest data
  • Automatic exponential backoff handles rate limiting gracefully

API Reference

GET /api/metrics

Fetch KV metrics for all namespaces or a specific namespace.

Query Parameters:

Parameter Type Description
range string Time range: 24h, 7d, or 30d (default: 7d)
namespaceId string Filter to specific namespace (optional)
skipCache boolean Set to true to bypass cache

Response Format

{
  "summary": {
    "timeRange": "7d",
    "startDate": "<YYYY-MM-DD>",
    "endDate": "<YYYY-MM-DD>",
    "totalOperations": 15420,
    "operationsByType": {
      "read": 12000,
      "write": 3000,
      "delete": 400,
      "list": 20
    },
    "avgLatencyMs": {
      "p50": 2.5,
      "p90": 5.1,
      "p99": 12.3
    },
    "totalKeyCount": 7500,
    "totalByteCount": 52428800,
    "namespaceCount": 3
  },
  "byNamespace": [
    {
      "namespaceId": "abc123",
      "namespaceName": "production-cache",
      "totalOperations": 10000,
      "operationsByType": { "read": 8000, "write": 2000 },
      "p50LatencyMs": 2.1,
      "p90LatencyMs": 4.5,
      "p99LatencyMs": 10.2,
      "currentKeyCount": 5000,
      "currentByteCount": 40000000
    }
  ],
  "operationsSeries": [
    {
      "date": "<YYYY-MM-DD>",
      "namespaceId": "abc123",
      "actionType": "read",
      "requests": 1500,
      "latencyMsP50": 2.4,
      "latencyMsP90": 4.8,
      "latencyMsP99": 11.2
    }
  ],
  "storageSeries": [
    {
      "date": "<YYYY-MM-DD>",
      "namespaceId": "abc123",
      "keyCount": 5000,
      "byteCount": 40000000
    }
  ]
}

GraphQL Datasets

KV Manager queries two Cloudflare GraphQL Analytics datasets:

Dataset Metrics Provided
kvOperationsAdaptiveGroups Request counts, latency percentiles (P50, P90, P99), action types
kvStorageAdaptiveGroups Key count, byte count per namespace

Notes

  • Metrics data comes from Cloudflare's Analytics API and may have a delay of a few minutes
  • Storage data is available for up to 31 days
  • The API token must have Account Analytics:Read permission to access metrics
  • In local development mode, mock data is displayed automatically

See Also

Clone this wiki locally