---
title: "aadhar.sh/garage/four free Cloudflare features, live"
description: "Four free Cloudflare Workers features running live: a Durable Objects counter, Workers AI captions, structured logs and custom trace spans."
path: "/garage/cloudflare"
section: "garage"
kind: "content"
updated: "2026-06-07"
source: "https://aadhar.sh/garage/cloudflare"
---

> Site index: https://aadhar.sh/llms.txt
> Section index: https://aadhar.sh/garage/llms.txt
> This is the Markdown twin of a page on aadhar.sh. The HTML at the source
> URL below is the original, and is hand-written and unminified on purpose.

# Four free Cloudflare features, live

The free Workers plan quietly bundles things that used to cost money or a separate service. I wired four of them to live demos here (**[Durable Objects][durable-object]**, **[Workers AI][workers-ai]**, **[Workers Logs][workers-logs]**, and **[custom trace spans][trace-span]**), behind a tiny worker (`cf-garage`) routed at `/garage/cf/*`. The buttons hit real endpoints; nothing is faked. A fifth, **[Browser Rendering][browser-run]**, I bound and deployed, then parked on the free tier's daily cap. Noted honestly below.

## 1 · Durable Objects: an atomic counter

A **strongly-consistent, single-instance** stateful object. The homepage's visitor counter uses [KV][workers-kv], which is [eventually-consistent][eventual-consistency] and capped at 1,000 writes/day, so a busy day silently stalls it. A DO increments *exactly once*, no race, 100k writes/day. It used to cost money; it's free now, and it fixes that counter cleanly.

press the button

```
env.COUNTER.get(id).fetch()  // SQLite-backed, atomic put
```

## 2 · Workers AI: caption a photo

Every model in the catalog, **10,000 neurons/day free**. This runs `@cf/llava-1.5-7b` over a real grid photo to generate alt-text. A small, fast vision model [hallucinates][ai-hallucination] charmingly now and then (it once called a cloudy sky a UFO). One binding call does it: no GPU, no key.

press the button

```
env.AI.run("@cf/llava-1.5-7b", { image, prompt }, { gateway: { id } })
```

That third argument arrived in **Aug 2026**, when Cloudflare folded Workers AI and **[AI Gateway][ai-gateway]** into one control plane. Before that, the gateway was a separate proxy you pointed a client at. Now it's an option on the call you were already making, and naming one gets the account full request and response payloads, token counts per model, and cost attribution, with nothing to set up first. Section 3's log line knows this call took about 5 seconds. It has never known what it cost.

Caching is off here on purpose. The button sends a byte-identical request every time, so one cached answer would quietly become every visitor's answer and the neuron counter would stop moving. The lede promises nothing is faked, and a replay is faked.

## 3 · Workers Logs: structured observability

**200,000 events/day, 3-day retention, free.** Every button above emitted a structured log line from the worker (`{ feature, ms, … }`), filterable and searchable in the dashboard. I can't show it *here* (the logs live in Cloudflare), but it's on: `[observability] enabled = true` in `wrangler.toml`. Click around, then watch them stream in `Workers & Pages → cf-garage → Logs`.

```
console.log(JSON.stringify({ path, feature, ms }))
```

## 4 · Custom spans: trace a request

Workers **auto-trace** every platform call (each `fetch`, KV read, DO call) into a waterfall in Observability. As of **Jun 16 2026** you can wrap your *own* logic in spans with `ctx.tracing.enterSpan()`, nested correctly. This endpoint runs a three-step pipeline (a Durable Object peek, a subrequest, and a compute loop), each in its own span with attributes. The canonical trace lands in Observability; the waterfall below is reconstructed live from the same span timings. (Run it twice: a cold Durable Object shows up as a fat first bar, then the warm path collapses to a few ms.)

press the button

```
ctx.tracing.enterSpan("do.counter.peek", async (span) => { span.setAttribute("counter.value", n) })
```

## The honest scorecard

All four ride the free Workers plan and **work live above**. Click them. They're shipped: a Durable Object increments with no race, Workers AI captions a real photo on a free GPU, every click leaves a structured log line, and a hand-instrumented request shows its own spans in the trace waterfall.

**The fifth, parked honestly: Browser Rendering.** [Headless Chromium][headless-browser] in a Worker via `env.BROWSER.quickAction("screenshot", options)`, the basis for on-the-fly `og:image` cards. I bind it and the worker deploys; no enable toggle exists (the binding is the access). The first implementation used [Puppeteer][puppeteer] for one screenshot and brought its whole [CDP][cdp] client into this Worker; the native Quick Action now owns the session lifecycle and keeps the same bounded navigation and paint-settle behavior without that dependency. A bare hit still no-ops, so crawlers can't burn the **10 browser-minutes/day** budget. It's unbuttoned here until the [OG-image][open-graph] use case earns that budget; trigger it by hand at `/garage/cf/screenshot?go=1`.

← back to the [garage](https://aadhar.sh/garage) · [aadhar.sh](https://aadhar.sh/)

demos hit a real worker (`cf-garage`) on the free Workers plan. nothing mocked.

[durable-object]: https://developers.cloudflare.com/durable-objects/ "A Cloudflare Workers object with its own built-in storage, where each named instance lives in one place so every request to it is coordinated."
[workers-ai]: https://developers.cloudflare.com/workers-ai/ "Cloudflare's service for running machine-learning models, such as language and vision models, on its own GPUs, called directly from a Worker."
[workers-logs]: https://developers.cloudflare.com/workers/observability/logs/workers-logs/ "Cloudflare's built-in log store for Workers. It collects each request's log lines so you can search and filter them in the dashboard."
[trace-span]: https://opentelemetry.io/docs/concepts/signals/traces/ "One timed step inside a traced request, with a name, a start time, a duration and attributes. Nested spans show where the time went."
[browser-run]: https://developers.cloudflare.com/browser-run/ "Cloudflare's service for controlling a headless browser from a Worker, to render pages, take screenshots or make PDFs."
[workers-kv]: https://developers.cloudflare.com/kv/ "Cloudflare's key-value store: values saved under names and copied worldwide, so reads are fast everywhere while a new write can take a minute to spread."
[eventual-consistency]: https://en.wikipedia.org/wiki/Eventual_consistency "A guarantee that every copy of some data will match in time, while a read right after a write may still return the old value."
[ai-hallucination]: https://en.wikipedia.org/wiki/Hallucination_(artificial_intelligence) "When an AI model confidently states something false or invented, like describing an object that isn't in the picture."
[ai-gateway]: https://developers.cloudflare.com/ai-gateway/ "Cloudflare's proxy for calls to AI models. It logs requests and responses, counts tokens and cost, and can cache or rate-limit calls."
[headless-browser]: https://en.wikipedia.org/wiki/Headless_browser "A web browser that runs with no window on screen, driven by code, so a program can load pages, run their scripts and capture the result."
[puppeteer]: https://pptr.dev/ "A JavaScript library for controlling Chrome or Firefox from code: opening pages, clicking, filling forms and taking screenshots."
[cdp]: https://chromedevtools.github.io/devtools-protocol/ "The message protocol Chrome's developer tools use to inspect and control the browser. Automation libraries like Puppeteer use it too."
[open-graph]: https://ogp.me/ "Meta tags a page uses to name the title, description and preview image that apps show when someone shares its link."

Source: https://aadhar.sh/garage/cloudflare
