Cloudflare Workers Otel Utels logo

Cloudflare Workers Otel Utels

Community
mizchi
cloudflare-workers-otel-utels

Cloudflare Worker telemetry at the fetch boundary — OTLP traces / metrics / logs + utels error tracking + D1 Proxy that emits slow-query warnings. Use when adding observability to a Worker without touching handler code.

Overview

Publishermizchi
Repositoryskills
Skill namecloudflare-workers-otel-utels
Stars
333
Forks
4
Bundled files
4
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by mizchi on GitHub. Read the source before you install it.

Installation

Install the Cloudflare Workers Otel Utels AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mizchi/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/cloudflare-workers-otel-utels .claude/skills/cloudflare-workers-otel-utels
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cloudflare Workers Otel Utels in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cloudflare Workers Otel Utels on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cloudflare Workers Otel Utels is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Cloudflare Workers OTel + utels boundary

Two wrappers that compose around a Worker's {fetch, scheduled} handler. Both are no-op pass-throughs unless their env vars are present, so you can run with neither, just one, or both.

withUtelsErrorTracking(withTelemetry(coreHandler))
  • withTelemetry — OTLP traces / metrics / logs push when any OTEL_EXPORTER_OTLP_* endpoint is configured. Also wraps every D1 binding with a Proxy that logs event: "d1.slow_query" to wrangler tail, even without OTLP, so the slow-query story works on a fresh deploy.
  • withUtelsErrorTracking — pushes one exception event per 5xx response or thrown exception to a utels.dev project. The endpoint, project ID, and ingest token are env-configured.

When to invoke

Use when you're:

  • Standing up observability on a new Worker, want OTLP-compatible traces and metrics to any backend (Honeycomb, Grafana Cloud, Tempo, Jaeger collector, …).
  • Adding server-side error tracking via utels without changing handler code.
  • Investigating a slow query: drop the threshold env var and watch wrangler tail.

What's in here

assets/scripts/telemetry-runtime.ts

The whole runtime, ready to drop into src/. Exports withTelemetry and withUtelsErrorTracking. Bundled by wrangler's esbuild at deploy.

Hot points to customize per-project:

  • DEFAULT_SERVICE_NAME — match your worker name.
  • EXACT_ROUTES — the set of paths that should NOT be normalized to "unmatched". Add your top-level routes.
  • routeForPath(pathname) — extend to collapse :id-style path params. High-card route attributes will explode trace and metric label cardinality if you skip this.

assets/scripts/d1-wrap.ts

The D1 Proxy wrap. Self-contained. Threads SQL templates through prepare → bind chains so the eventual terminal op (first / run / all / raw) records the right statement. Records bindingName, op, sql, durationMs, ok. Strongly typed; safe to use as the entry to type the rest of your telemetry pipeline.

Exports a Recorder = (query: RecordedQuery) => void so you can plug it into something other than the bundled withTelemetry if you have a different aggregation story.

assets/tests/d1-wrap.test.ts and telemetry.test.ts

Reference tests. The d1-wrap test uses mock D1 bindings to validate the Proxy chain + slow-threshold + recorder shape. The telemetry test asserts that 5xx responses + thrown exceptions both produce utels events.

Wiring

typescript
// src/worker.ts
import { withTelemetry, withUtelsErrorTracking } from "./telemetry-runtime.ts";

const coreHandler = { fetch(req, env, ctx) { /* ... */ } };
const fetchHandler = withUtelsErrorTracking(withTelemetry(coreHandler));

export default {
  fetch: fetchHandler.fetch,
};
jsonc
// wrangler.jsonc
{
  "vars": {
    "OTEL_SERVICE_NAME": "my-app",
    "OTEL_SERVICE_VERSION": "0.1.0",
    "DEPLOY_ENV": "production",
    // Optional utels
    "UTELS_ENDPOINT": "https://utels.dev/__utels?v=1",
    "UTELS_PROJECT_ID": "my-app-prod",
    "UTELS_RELEASE": "0.1.0"
  }
}
bash
# Optional OTLP. Set any of these to enable trace/metric/log push.
pnpm exec dotenvx set OTEL_EXPORTER_OTLP_ENDPOINT https://api.honeycomb.io -f .env.cloudflare
pnpm exec dotenvx set OTEL_EXPORTER_OTLP_HEADERS "x-honeycomb-team=<key>" -f .env.cloudflare

# Optional utels ingest token (wrangler secret, not committed)
pnpm exec wrangler secret put UTELS_INGEST_TOKEN

Disable individually with OTEL_SDK_DISABLED=true or UTELS_DISABLED=true.

Slow-query independence

withTelemetry ALWAYS wraps D1 bindings with the Proxy. Even when OTLP is unconfigured, every query whose duration crosses APP_D1_SLOW_THRESHOLD_MS (default 250ms) gets logged as a structured console.warn that wrangler tail picks up. This is the cheapest possible "is my query slow?" loop — works on day-one of a new deploy.

References

Source

The runtime is identical to mizchi/cloudflare-starterkit-mbt and mizchi/mnemo.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Cloudflare Workers Otel Utels AI skill do?

Cloudflare Worker telemetry at the fetch boundary — OTLP traces / metrics / logs + utels error tracking + D1 Proxy that emits slow-query warnings. Use when adding observability to a Worker without touching handler code.

Why use Cloudflare Workers Otel Utels on TypingMind?

Because you install it once and use it with any model. Cloudflare Workers Otel Utels is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cloudflare Workers Otel Utels in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mizchi/skills/tree/main/cloudflare-workers-otel-utels. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Cloudflare Workers Otel Utels?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cloudflare Workers Otel Utels?

As many as you like. As long as a model supports skills, you can use Cloudflare Workers Otel Utels with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cloudflare Workers Otel Utels AI skill free?

It is published on GitHub by mizchi. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇