Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Write to Analytics Engine

A guide for implementing custom event tracking by configuring Wrangler bindings, structuring data points with blobs and doubles, and querying results via the SQL API.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Write to Analytics Engine

A guide for implementing custom event tracking by configuring Wrangler bindings, structuring data points with blobs and doubles, and querying results via the SQL API.

When To Use

Use when you need to implement high-cardinality time-series event tracking, such as building usage-based billing or monitoring per-customer service health within a Cloudflare Worker.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-analytics-engine-write-to-workflow-guide.mdA markdown guide demonstrating how to configure bindings and write custom data points to the Cloudflare Workers Analytics Engine.Questions about a markdown guide demonstrating how to configure bindings and write custom data points to the Cloudflare Workers Analy...
examples/workers-examples-analytics-engine-write-to-cloudflare-workers-analytics-.textA text-based example demonstrating how to write data to a Cloudflare Analytics Engine dataset from a Worker.Exact payloads, commands, or snippets shown in A text-based example demonstrating how to write data to a Cloudflare Analytics Engine dataset from a Worker.
examples/workers-examples-analytics-engine-write-to-cloudflare-workers-analytics--2.textA configuration snippet showing how to define an analytics engine binding and dataset within a Cloudflare Workers environment.Exact payloads, commands, or snippets shown in A configuration snippet showing how to define an analytics engine binding and dataset within a Cloudflare Workers env...
examples/workers-examples-analytics-engine-write-to-cloudflare-workers-analytics--3.textA JavaScript example demonstrating how to use the writeDataPoint method within a Cloudflare Worker to send custom events to the Analytics Engine.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the writeDataPoint method within a Cloudflare Worker to send custom eve...
examples/workers-examples-analytics-engine-write-to-cloudflare-workers-analytics--4.textA TypeScript example demonstrating how to use the Analytics Engine dataset to write data points within a Cloudflare Worker fetch handler.Exact payloads, commands, or snippets shown in A TypeScript example demonstrating how to use the Analytics Engine dataset to write data points within a Cloudflare W...
examples/workers-examples-analytics-engine-write-to-cloudflare-workers-analytics--5.textA curl command demonstrating how to query the Cloudflare Analytics Engine using SQL via the API.Exact payloads, commands, or snippets shown in A curl command demonstrating how to query the Cloudflare Analytics Engine using SQL via the API.

What This Skill Covers

  • Write custom analytics events to Workers Analytics Engine.
  • Main sections: Configure the binding, Write data points, Data point structure, Query your data, Related resources.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/examples/analytics-engine