backfill-cf-analytics

Replay Cloudflare GraphQL analytics into Datadog to fill gaps left by sync outages.

7|12|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/OpenRouterTeam/docs --skill backfill-cf-analytics-openrouterteam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: backfill-cf-analytics
Source: https://github.com/OpenRouterTeam/docs/tree/main/.agents/skills/backfill-cf-analytics
Command: npx skills add https://github.com/OpenRouterTeam/docs --skill backfill-cf-analytics-openrouterteam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? When the Cloudflare-to-Datadog analytics sync cron goes down for more than 30 minutes, it leaves a permanent gap in the openrouter.cloudflare.* metrics because the cron only ever queries the last 30 minutes. This Skill walks you through finding the gap, replaying the missing range, and verifying the points actually landed. ## Core Features & Use Cases - Gap Detection: Query Datadog metrics to locate the exact boundaries of the missing data and confirm the sync has recovered before replaying. - Guided Backfill: Run scripts/cf-analytics-backfill.ts with Infisical-managed credentials over half-open, whole-minute ranges split into 30-minute chunks, with automatic retries and per-window failure reporting. - Verification & Latency Awareness: Understand Datadog historical metrics ingestion (HMI) requirements and latency windows so you don't re-run unnecessarily. - Use Case: The [CF Analytics] GraphQL to Datadog sync is dead monitor fires after a two-hour outage; use this Skill to identify the gap, backfill it safely, and confirm the graph is whole again. ## Quick Start Ask the agent to backfill the Cloudflare analytics gap in Datadog for the affected time range after the cf-analytics-sync outage.

Frequently Asked Questions about backfill-cf-analytics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I backfill missing Cloudflare analytics into Datadog?▼

Export CLOUDFLARE_ANALYTICS_TOKEN and DD_API_KEY via Infisical, then run scripts/cf-analytics-backfill.ts with --start and --end ISO timestamps covering the gap. The script replays every dataset the cron syncs in 30-minute chunks at original timestamps.

How do I find the gap in Cloudflare metrics after a sync outage?▼

Query a high-volume metric like openrouter.cloudflare.workersInvocationsAdaptive.sum.requests in Datadog over a wide range. Take the last point before the gap and first point after it, rounding outward to whole minutes since adjacent buckets are partially filled.

Why is my Datadog graph still empty right after running the backfill?▼

Historical metrics ingestion is delayed based on point age: up to 1 hour for same-day points, up to 14 hours for points 12 hours to 30 days old. Wait out the latency window before re-running, since re-submission is safe but billed as indexed custom metrics.

Can I re-run the backfill over a range that was already covered?▼

Yes, re-running is safe because the series are gauges, so identical points overwrite and Datadog keeps the most recently submitted value. However, avoid gratuitous re-runs since historical points are billed as indexed custom metrics.

What are the limitations of backfilling Cloudflare GraphQL analytics?▼

Cloudflare retains minute-granularity adaptive datasets for days, not weeks, so old gaps have no source data. The --end must also be at least four minutes before now because Cloudflare's ingestion lags real time and would otherwise overwrite good points with undercounted values.