Agent skill

Cloudflare Workers Observability

by secondsky in secondsky/claude-skills

Cloudflare Workers observability with logging, Analytics Engine, Tail Workers, metrics, and alerting.

MITAuto-check passedDevOps & Cloud

Install Cloudflare Workers Observability

skills CLI
$ npx skills add secondsky/claude-skills --skill cloudflare-workers-observability -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install secondsky/claude-skills cloudflare-workers-observability --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/cloudflare-workers/skills/cloudflare-workers-observability .claude/skills/cloudflare-workers-observability && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cloudflare-workers-observability
GitHub stars
227
Token cost
~2.3k tokens
SKILL.md length
364 words
Files
11 (incl. scripts, references)
Skills in repo
169
Repo updated
First seen
Licence
MIT

At a glance

Cloudflare Workers observability with logging, Analytics Engine, Tail Workers, metrics, and alerting.

  • Works in 5 steps: Always use structured JSON logging -… → Include request context - Request ID,… → Never log sensitive data - Redact… → …
  • Encountering log parsing
  • SKILL.md covers Quick Start, Critical Rules, Observability Components and Top 8 Errors Prevented, plus 8 more sections
  • Runs TypeScript and Shell scripts from its folder

What it does

Cloudflare Workers Observability is an agent skill from secondsky/claude-skills. Cloudflare Workers observability with logging, Analytics Engine, Tail Workers, metrics, and alerting. Use for monitoring, debugging, tracing, or encountering log parsing, metric aggregation, alert configuration errors.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 13 other files, including scripts and reference files (for example `references/alerting.md`, `references/analytics-engine.md` and `references/custom-metrics.md`).

It sits in DevOps & Cloud, covering Observability. It works with Cloudflare Workers. The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • Encountering log parsing
  • Metric aggregation
  • Alert configuration errors

Example prompts

  • “/cloudflare-workers-observability”

Requirements

  • Node.js
  • A Bash shell

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  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

What it can do on your machine

Read from SKILL.md and the folder at commit 8837836. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (TypeScript and Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developers.cloudflare.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cloudflare Workers Observability loads about 2.3k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 63 tokens; SKILL.md has 364 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 364 words, ~2,300 tokens.

Download SKILL.mdSave it as .claude/skills/cloudflare-workers-observability/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
cloudflare-workers-observability
description
Cloudflare Workers observability with logging, Analytics Engine, Tail Workers, metrics, and alerting. Use for monitoring, debugging, tracing, or encountering log parsing, metric aggregation, alert configuration errors.
license
MIT

Cloudflare Workers Observability

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

Quick Start

typescript
// 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

ComponentPurposeWhen to Use
console.logBasic loggingDevelopment, debugging
Tail WorkersReal-time log streamingProduction log aggregation
Analytics EngineCustom metrics/analyticsBusiness metrics, performance tracking
LogpushLog export to external servicesLong-term storage, compliance
Workers Trace EventsDistributed tracingRequest flow debugging

Top 8 Errors Prevented

ErrorSymptomPrevention
Logs not appearingNo output in dashboardEnable "Standard" logging in wrangler.jsonc
Log truncationMessages cut off at 128KBChunk large payloads, use sampling
Tail Worker not receivingNo events processedCheck binding name matches wrangler.jsonc
Analytics Engine write failsData not recordedVerify AE binding, check blobs format
PII in logsSecurity/compliance violationImplement redaction middleware
Missing request contextCan't correlate logsAdd requestId to all log entries
Log volume explosionHigh costs, noiseImplement sampling for high-frequency events
Alerting gapsIncidents not detectedConfigure monitors for error rate thresholds
Show full SKILL.md (139 more words)Show less

Logging Configuration

wrangler.jsonc:

jsonc
{
  "name": "my-worker",
  "observability": {
    "enabled": true,
    "head_sampling_rate": 1 // 0-1, 1 = 100% of requests
  },
  "tail_consumers": [
    {
      "service": "log-aggregator", // Tail Worker name
      "environment": "production"
    }
  ],
  "analytics_engine_datasets": [
    {
      "binding": "ANALYTICS",
      "dataset": "my_worker_metrics"
    }
  ]
}

Structured Logging Pattern

typescript
interface LogEntry {
  level: 'debug' | 'info' | 'warn' | 'error';
  message: string;
  requestId: string;
  timestamp: number;
  // Contextual data
  method?: string;
  path?: string;
  status?: number;
  duration?: number;
  // Error details
  error?: {
    name: string;
    message: string;
    stack?: string;
  };
  // Custom fields
  [key: string]: unknown;
}

class Logger {
  constructor(private requestId: string, private baseContext: object = {}) {}

  private log(level: LogEntry['level'], message: string, data?: object) {
    const entry: LogEntry = {
      level,
      message,
      requestId: this.requestId,
      timestamp: Date.now(),
      ...this.baseContext,
      ...data,
    };

    // Redact sensitive fields
    const sanitized = this.redact(entry);

    const output = JSON.stringify(sanitized);
    level === 'error' ? console.error(output) : console.log(output);
  }

  private redact(entry: LogEntry): LogEntry {
    const sensitiveKeys = ['password', 'token', 'secret', 'authorization', 'cookie'];
    const redacted = { ...entry };

    for (const key of Object.keys(redacted)) {
      if (sensitiveKeys.some(s => key.toLowerCase().includes(s))) {
        redacted[key] = '[REDACTED]';
      }
    }
    return redacted;
  }

  info(message: string, data?: object) { this.log('info', message, data); }
  warn(message: string, data?: object) { this.log('warn', message, data); }
  error(message: string, data?: object) { this.log('error', message, data); }
  debug(message: string, data?: object) { this.log('debug', message, data); }
}

Analytics Engine Usage

typescript
interface Env {
  ANALYTICS: AnalyticsEngineDataset;
}

export default {
  async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
    const start = Date.now();
    const url = new URL(request.url);

    try {
      const response = await handleRequest(request, env);

      // Write success metric
      env.ANALYTICS.writeDataPoint({
        blobs: [request.method, url.pathname, String(response.status)],
        doubles: [Date.now() - start], // Response time in ms
        indexes: [url.pathname.split('/')[1] || 'root'], // Index for fast queries
      });

      return response;
    } catch (error) {
      // Write error metric
      env.ANALYTICS.writeDataPoint({
        blobs: [request.method, url.pathname, 'error', error.message],
        doubles: [Date.now() - start],
        indexes: ['error'],
      });
      throw error;
    }
  }
};

Tail Worker Pattern

typescript
// tail-worker.ts - Receives logs from other workers
interface TailEvent {
  scriptName: string;
  event: {
    request?: { method: string; url: string };
    response?: { status: number };
  };
  logs: Array<{
    level: string;
    message: unknown[];
    timestamp: number;
  }>;
  exceptions: Array<{
    name: string;
    message: string;
    timestamp: number;
  }>;
  outcome: 'ok' | 'exception' | 'exceededCpu' | 'exceededMemory' | 'canceled';
  eventTimestamp: number;
}

export default {
  async tail(events: TailEvent[], env: Env): Promise<void> {
    for (const event of events) {
      // Filter and forward logs
      const errorLogs = event.logs.filter(l => l.level === 'error');
      const exceptions = event.exceptions;

      if (errorLogs.length > 0 || exceptions.length > 0) {
        // Send to external logging service
        await fetch(env.LOGGING_ENDPOINT, {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({
            scriptName: event.scriptName,
            timestamp: event.eventTimestamp,
            errors: errorLogs,
            exceptions,
            outcome: event.outcome,
          }),
        });
      }
    }
  }
};

When to Load References

Load specific references based on the task:

  • Setting up logging? → Load references/logging.md for structured logging patterns, log levels, redaction
  • Building custom metrics? → Load references/analytics-engine.md for Analytics Engine SQL queries, data modeling
  • Implementing log aggregation? → Load references/tail-workers.md for Tail Worker patterns, external service integration
  • Creating dashboards/tracking? → Load references/custom-metrics.md for business metrics, performance tracking
  • Setting up alerts? → Load references/alerting.md for error rate monitoring, PagerDuty/Slack integration

Templates

TemplatePurposeUse When
templates/logging-setup.tsProduction logging classSetting up new worker with logging
templates/analytics-worker.tsAnalytics Engine integrationAdding custom metrics
templates/tail-worker.tsComplete Tail WorkerBuilding log aggregation pipeline

Scripts

ScriptPurposeCommand
scripts/setup-logging.shConfigure logging settings./setup-logging.sh
scripts/analyze-logs.shQuery and analyze logs./analyze-logs.sh --errors --last 1h

Resources

© secondsky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files (scripts, references) in plugins/cloudflare-workers/skills/cloudflare-workers-observability of secondsky/claude-skills.

  • SKILL.md
  • references/alerting.md
  • references/analytics-engine.md
  • references/custom-metrics.md
  • references/logging.md
  • references/tail-workers.md
  • scripts/analyze-logs.sh
  • scripts/setup-logging.sh
  • templates/analytics-worker.ts
  • templates/logging-setup.ts
  • templates/tail-worker.ts

Open the folder on GitHubat commit 8837836

Compare with similar skills

Cloudflare Workers Observability next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cloudflare Workers Observability compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cloudflare Workers Observability this skillsecondsky/claude-skills227—~2.3kAutomated safety check: PassMIT
Observability Triageevery-app/open-seo23k—~1.7kAutomated safety check: PassMIT
Debug Cloudflare Workers ObservabilityConsensys/c0105—~1.2kAutomated safety check: NotesLGPL-3.0
Workers Best Practiceshodgef/apiker1276 repos~1.8kAutomated safety check: PassMIT
Effect Httpapi Workers PatternsConsensys/c0105—~1.4kAutomated safety check: PassLGPL-3.0
Frontmcp Production Readinessagentfront/frontmcp146—~6.5kAutomated safety check: PassApache-2.0

Similar skills

  • Observability Triage

    every-app/open-seo

    Triage OpenSEO production errors in Cloudflare Workers Observability — verified query recipes, counting gotchas, and a known-noise filter list applied automatically.

    23k GitHub stars~1.7k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Debug deployed Cloudflare Workers using the cfobservability MCP, Wrangler, D1/R2 state, repo evidence, and safe live reproduction.

    105 GitHub stars~1.2k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check: notes
  • Reviews and authors Cloudflare Workers code against production best practices.

    127 GitHub starsUsed in 6 repos~1.8k tokens
    DevOps & CloudAuto-check passed
  • Build, refactor, or review Effect v4 HttpApi services on Cloudflare Workers.

    105 GitHub stars~1.4k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Pre-production audit, hardening, and go-live checklists for FrontMCP servers.

    146 GitHub stars~6.5k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Cloudflare Worker telemetry at the fetch boundary — OTLP traces / metrics / logs + utels error tracking + D1 Proxy that emits slow-query warnings.

    356 GitHub stars~1.4k tokensUpdated 5 days ago
    DevOps & CloudAuto-check: notes

More from secondsky/claude-skills

All 169 skills in this repo
  • Tanstack AI

    secondsky/claude-skills

    TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.

    227 GitHub starsUsed in 1 repo~3.6k tokens
    Auto-check: notes
  • Auto Animate

    secondsky/claude-skills

    AutoAnimate (@formkit/auto-animate) zero-config animations for React.

    227 GitHub stars~2.9k tokensUpdated 9 days ago
    Auto-check passed
  • Base UI React

    secondsky/claude-skills

    MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.

    227 GitHub stars~1.9k tokensUpdated 9 days ago
    Auto-check passed
  • Cloudflare Images

    secondsky/claude-skills

    This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…

    227 GitHub stars~3.6k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Sandbox

    secondsky/claude-skills

    Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.

    227 GitHub stars~4.5k tokensUpdated 9 days ago
    Auto-check passed

Categories

Questions about Cloudflare Workers Observability

What does Cloudflare Workers Observability do?

Cloudflare Workers observability with logging, Analytics Engine, Tail Workers, metrics, and alerting. Cloudflare Workers Observability is an agent skill from secondsky/claude-skills. Cloudflare Workers observability with logging, Analytics Engine, Tail Workers, metrics, and alerting.

When should I use Cloudflare Workers Observability?

Cloudflare Workers Observability fits situations like: encountering log parsing; metric aggregation; alert configuration errors.

How do I install Cloudflare Workers Observability in Claude Code?

Run `npx skills add secondsky/claude-skills --skill cloudflare-workers-observability -a claude-code`. Or copy the skill folder (plugins/cloudflare-workers/skills/cloudflare-workers-observability in secondsky/claude-skills) into .claude/skills/cloudflare-workers-observability in your project. Claude Code loads it when a task matches its description.

How do I install Cloudflare Workers Observability in Codex?

Run `npx skills add secondsky/claude-skills --skill cloudflare-workers-observability -a codex`. Or copy the skill folder (plugins/cloudflare-workers/skills/cloudflare-workers-observability in secondsky/claude-skills) into .agents/skills/cloudflare-workers-observability in your project. Codex loads it when a task matches its description.

Can I use Cloudflare Workers Observability in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secondsky/claude-skills --skill cloudflare-workers-observability -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cloudflare-workers-observability, .gemini/skills/cloudflare-workers-observability, .github/skills/cloudflare-workers-observability and .opencode/skills/cloudflare-workers-observability in your project.

What does Cloudflare Workers Observability need to run?

Going by SKILL.md and its folder, Cloudflare Workers Observability needs TypeScript and a shell for the scripts in its folder. Our summary lists: Node.js; A Bash shell.

Does Cloudflare Workers Observability access the network?

SKILL.md names 1 domain. As links in the text: developers.cloudflare.com. This is read from the text; nothing was executed.

Is Cloudflare Workers Observability safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Cloudflare Workers Observability use?

Cloudflare Workers Observability is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cloudflare Workers Observability use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 11k tokens, read only when the agent opens those files.

What are the alternatives to Cloudflare Workers Observability?

Skills that share tags, products or a category with Cloudflare Workers Observability: Observability Triage (every-app/open-seo, 23k stars), Debug Cloudflare Workers Observability (Consensys/c0, 105 stars), Workers Best Practices (hodgef/apiker, 127 stars) and Effect Httpapi Workers Patterns (Consensys/c0, 105 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cloudflare Workers Observability?

secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.

Source: secondsky/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.