observability

observability is a skill for Claude Code, Codex from Mark-Life/agent-skills. It costs 114 tokens per session (5,406 once invoked), scanned A, original, MIT.

A guide for recording useful information about requests, background jobs, and other units of work in TypeScript services. It covers logs, traces, metrics, and OpenTelemetry, a standard way to send monitoring data to other tools.

In plain words
What is it for?
Use it when adding or reviewing service monitoring, designing request or job records, connecting OpenTelemetry, or investigating production problems.
Why use it?
It helps developers understand what happened in production without searching through scattered or incomplete records. It also helps choose details that can be grouped and analysed later.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

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.

agentmods
npx agentmods add skills/mark-life/agent-skills/observability
Any agent
npx skills add Mark-Life/agent-skills --skill observability
Clone the repo
git clone --depth 1 https://github.com/Mark-Life/agent-skills

Made for: Claude Code, Codex.

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 observability

README.md
[![agentmods](https://agentmods.dev/badge/skills/mark-life/agent-skills/observability.svg)](https://agentmods.dev/skills/mark-life/agent-skills/observability)
Your own site
<a href="https://agentmods.dev/skills/mark-life/agent-skills/observability"><img src="https://agentmods.dev/badge/skills/mark-life/agent-skills/observability.svg" alt="Measured on agentmods" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,406 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00114 $0.05406
Opus 5 $0.00057 $0.02703
Sonnet 5 $0.00023 $0.01081
Haiku 4.5 $0.00011 $0.00541

Measured 5d ago against content hash 3152f13520c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

observability scanned grade A with 0 findings 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 5d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/coding-workflows/observability/SKILL.md · 492 lines

How it starts

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

Observability

Record what happened to this request, not what the code is doing. One canonical record per unit of work, carrying every dimension you would want to group by later. Run each section's Check before calling the instrumentation done.

One wide event per unit of work

A request, job, or run emits exactly one rich record — a wide event, or canonical log line. Capture the immutable facts before the work starts, accumulate the outcome into a mutable record as it runs, emit where every path converges. In imperative code that is finally, over an accumulator declared beside the frozen context (telegram-claude, src/bot.ts):

// Wide-event context captured up front so every return path emits once.
const meta: RunEventMeta = { runId: crypto.randomUUID(), userId, provider,
  project, promptChars: prompt.length, queueDepth: state.queue.length };
const rec: RunRecord = { outcome: "done", costUsd: null, turns: null,
  totalTokens: null, durationMs: null, sessionId: sessionId ?? null };

try {
  /* … the work, folding results into `rec` … */
} catch (e) {
  rec.outcome = "errored";
  rec.errorClass =
    (e as { _tag?: string })?._tag ?? (e as Error)?.name ?? "ProviderCrashed";
  rec.errorMessage = clipError(String((e as Error)?.message ?? e));
} finally {
  await emitRunEvent(rec, meta);
}

In Effect, Effect.onExit is the equivalent and covers interrupts too, reading the accumulated Refs so a SIGINT still emits a complete row (factory, packages/orchestrator/src/orchestrator.ts, restyled from nested flatMap):

Effect.onExit((exit) =>
  Effect.gen(function* () {
    yield* recordRun({
      ctx,
      result: yield* Ref.get(outcomeRef),
      parked: yield* Ref.get(parkedRef),
      interrupted: Exit.hasInterrupts(exit),
    });
  })
)

Stamp a marker so sinks, tests, and log tooling can select the event among everything else the process prints — event: "factory.run", event: "telegram.run" — one exported constant, the single filter key.

Read the full file on GitHub · 492 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 492 lines · 114 tokens per session scan A 3152f13520c9

Subscribe to this mod's changes

observability is a skill published in the GitHub repository Mark-Life/agent-skills (2 stars, last pushed 21d ago), licensed MIT. It adds 114 tokens to every session and 5,406 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.