cloudflare-workers-observability

cloudflare-workers-observability is a skill for Claude Code from secondsky/claude-skills. It costs 47 tokens per session (2,146 once invoked), scanned A, original, MIT.

A guide to observing Cloudflare Workers in production through logs, metrics, traces, Analytics Engine, Tail Workers, and alerts. These tools show what requests are doing and when something goes wrong.

In plain words
What is it for?
Use it to add structured logs, track metrics, trace requests, configure alerts, and investigate production errors.
Why use it?
It helps find failures and performance problems by connecting individual requests with logs and measured system behavior.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cloudflare-workers plugin — 10 skills, 5 commands shipped together

Good fit Use it to add structured logs, track metrics, trace requests, configure alerts, and investigate production errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/secondsky/claude-skills/cloudflare-workers-observability
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add secondsky/claude-skills --skill cloudflare-workers-observability
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

Or install cloudflare-workers, the plugin that ships this one along with the rest of its 10 skills, 5 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cloudflare-workers-observability

README.md
[![agentmods](https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-workers-observability.svg)](https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-workers-observability)
Your own site
<a href="https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-workers-observability"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-workers-observability.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,146 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.02146
Opus 5 $0.00023 $0.01073
Sonnet 5 $0.00009 $0.00429
Haiku 4.5 $0.00005 $0.00215

Measured 4d ago against content hash 15eb060fd940, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

cloudflare-workers-observability scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/analyze-logs.sh, scripts/setup-logging.sh, templates/analytics-worker.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
plugins/cloudflare-workers/skills/cloudflare-workers-observability/SKILL.md · 279 lines

How it starts

The opening of the file, as written. The whole thing — 279 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cloudflare Workers Observability

Production-grade observability for Cloudflare Workers: logging, metrics, tracing, and alerting.

Quick Start

// Structured logging with context
export default {
  async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
    const requestId = crypto.randomUUID();
    const logger = createLogger(requestId, env);

    try {
      logger.info('Request received', { method: request.method, url: request.url });

      const result = await handleRequest(request, env);

      logger.info('Request completed', { status: result.status });
      return result;
    } catch (error) {
      logger.error('Request failed', { error: error.message, stack: error.stack });
      throw error;
    }
  }
};

// Simple logger factory
function createLogger(requestId: string, env: Env) {
  return {
    info: (msg: string, data?: object) => console.log(JSON.stringify({ level: 'info', requestId, msg, ...data, timestamp: Date.now() })),
    error: (msg: string, data?: object) => console.error(JSON.stringify({ level: 'error', requestId, msg, ...data, timestamp: Date.now() })),
    warn: (msg: string, data?: object) => console.warn(JSON.stringify({ level: 'warn', requestId, msg, ...data, timestamp: Date.now() })),
  };
}

Critical Rules

  1. Always use structured JSON logging - Plain text logs are hard to parse and aggregate
  2. Include request context - Request ID, method, path in every log entry
  3. Never log sensitive data - Redact tokens, passwords, PII from logs
  4. Use appropriate log levels - ERROR for failures, WARN for recoverable issues, INFO for operations
  5. Sample high-volume logs - Use 1-10% sampling for request logs in production

Observability Components

Component Purpose When to Use
console.log Basic logging Development, debugging
Tail Workers Real-time log streaming Production log aggregation
Analytics Engine Custom metrics/analytics Business metrics, performance tracking
Logpush Log export to external services Long-term storage, compliance
Workers Trace Events Distributed tracing Request flow debugging

Read the full file on GitHub · 279 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 279 lines · 47 tokens per session scan A 15eb060fd940

Subscribe to this mod's changes

cloudflare-workers-observability is a skill published in the GitHub repository secondsky/claude-skills (215 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 2,146 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.