observability-and-instrumentation

observability-and-instrumentation is a skill for Claude Code from vinvcn/addyosmani-agent-skills-zh. It costs 79 tokens per session (3,704 once invoked), scanned A, original, MIT.

A set of instructions for adding observability to software: logs, measurements, and other signals that show what a system is doing from the outside. It focuses on adding this information while building features, services, background jobs, and integrations.

In plain words
What is it for?
Use it when adding or reviewing telemetry, alerts, retries, queues, network calls, or other production code. It helps choose between logs for individual events and measurements for overall rates or timing.
Why use it?
Without these signals, diagnosing a production failure means guessing what happened after the fact. The guidance helps connect each signal to a question an on-call engineer needs to answer.

Skill for Claude Code

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

Part of the agent-skills plugin — 26 skills, 10 commands, 4 agents shipped together

Good fit Use it when adding or reviewing telemetry, alerts, retries, queues, network calls, or other production code. It helps choose between logs for individual events and measurements for overall rates or timing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vinvcn/addyosmani-agent-skills-zh/observability-and-instrumentation
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 vinvcn/addyosmani-agent-skills-zh --skill observability-and-instrumentation
Clone the repo
git clone --depth 1 https://github.com/vinvcn/addyosmani-agent-skills-zh

Made for: Claude Code.

Or install agent-skills, the plugin that ships this one along with the rest of its 26 skills, 10 commands, 4 agents.

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-and-instrumentation

README.md
[![agentmods](https://agentmods.dev/badge/skills/vinvcn/addyosmani-agent-skills-zh/observability-and-instrumentation/github.svg)](https://agentmods.dev/skills/vinvcn/addyosmani-agent-skills-zh/observability-and-instrumentation)
Your own site
<a href="https://agentmods.dev/skills/vinvcn/addyosmani-agent-skills-zh/observability-and-instrumentation"><img src="https://agentmods.dev/badge/skills/vinvcn/addyosmani-agent-skills-zh/observability-and-instrumentation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for observability-and-instrumentation

Your own site · 80×15
<a href="https://agentmods.dev/skills/vinvcn/addyosmani-agent-skills-zh/observability-and-instrumentation"><img src="https://agentmods.dev/badge/skills/vinvcn/addyosmani-agent-skills-zh/observability-and-instrumentation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,704 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00079 $0.03704
Opus 5.5 $0.00032 $0.01482
Sonnet 5.5 $0.00016 $0.00741
Haiku 4.5 $0.00008 $0.00370

Measured 1mo ago against content hash 97a19f405536, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

observability-and-instrumentation 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 1mo 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/observability-and-instrumentation/SKILL.md · 239 lines

How it starts

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

可观测性与埋点

概览

无法观测的代码,就无法运维。可观测性是指:借助代码发出的 telemetry,从外部回答“系统正在做什么、为什么”。埋点不是上线后的附加项——它和功能代码一起写,就像测试一样。如果一个功能在没有 telemetry 的情况下发布,第一个用户上报的 bug 就变成了考古,而不是查询。

何时使用

  • 构建任何会跑在生产环境的功能
  • 添加新的服务、endpoint、后台 job 或外部集成
  • 一次生产事故的诊断花了太久("we couldn't tell what happened")
  • 建立或评审告警规则
  • 评审一个新增 I/O、重试、队列或跨服务调用的 PR

不适用于:

  • 诊断正在发生的故障——用 debugging-and-error-recovery skill(可观测性正是让这个 skill 下次跑得快的东西)
  • 对已测量出的慢做 profiling 和优化——用 performance-optimization skill
  • 发布日的监控 checklist 和回滚触发器——见 shipping-and-launch skill;本 skill 覆盖的是喂养它们的那层埋点

流程

1. 先定义“能工作”,再埋点

没有问题支撑的 telemetry 就是噪音。在添加任何埋点之前,写下 on-call 工程师针对这个功能会问的 2–4 个问题:

FEATURE: checkout payment retry
QUESTIONS ON-CALL WILL ASK:
1. What fraction of payments succeed on first attempt vs after retry?
2. When a payment fails permanently, why? (provider error? timeout? validation?)
3. Is the payment provider slower than usual?
→ Every signal below must help answer one of these.

如果你说不出这些问题,你就还没准备好埋点——你会把一切写进日志,然后什么也学不到。

2. 为每个问题选对信号

信号 回答什么 成本特征 例子
结构化日志 “这个具体案例里发生了什么?” 按事件计;随流量增长 带 provider 错误码的 payment_failed
指标 “聚合来看,多频繁 / 多快?” 每个 series 固定;查询便宜 provider 调用的 p99 延迟
Trace “时间花在了跨服务的哪一段?” 按请求计;通常采样 一次慢 checkout,按 hop 拆开看

经验法则:指标告诉你出了什么问题,trace 告诉你问题在哪里,日志告诉你为什么。

3. 结构化日志

记录事件,不是散文。每一行日志都是一个 JSON object,带有稳定的事件名和机器可读的字段:

// BAD: string interpolation — unqueryable, inconsistent
logger.info(`Payment ${id} failed for user ${userId} after ${n} retries`);

// GOOD: stable event name + structured fields
logger.warn({
  event: 'payment_failed',
  paymentId: id,
  provider: 'stripe',
  errorCode: err.code,
  attempt: n,
}, 'payment failed');

日志级别——用得体一致:

级别 含义 On-call 的动作
error 不变量被打破;可能有人需要采取行动 调查
warn 降级但已处理(重试成功、用了 fallback) 留意趋势
info 重要的业务事件(下单完成、job 结束) 无
debug 诊断细节 生产环境默认关闭

Correlation ID 是强制的。 在系统边界生成(或接受)一个 request ID,并把它附加到每一行日志、每个 span 和每次对外调用上。没有它,你无法从交错的日志里重建出单个请求:

Read the full file on GitHub · 239 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. 1mo ago First seen · 239 lines · 79 tokens per session scan A 97a19f405536

Subscribe to this mod's changes

observability-and-instrumentation is a skill published in the GitHub repository vinvcn/addyosmani-agent-skills-zh (43 stars, last pushed yesterday), licensed MIT. It adds 79 tokens to every session and 3,704 once invoked, about $0.0003 per session on Opus 5.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-09-16.

Related

Other skills, from other repositories

test-driven-development

Drives development with tests via Red-Green-Refactor and the Prove-It pattern, with hard rules against weakening assertions or faking green suites. Use when implementing any logic, fixing any bug, or changing any behavior. Triggers on "add a feature", "fix this bug", "write tests", or any task where done must be…

borhen68/SkillEngine · 79 tokens

debugging-and-error-recovery

Guides systematic root-cause debugging with hard rules against guess-fixes and symptom suppression. Use when tests fail, builds break, behavior doesn't match expectations, or you encounter any unexpected error. Triggers on "this is broken", "tests are failing", "why doesn't this work", or any error output.

borhen68/SkillEngine · 69 tokens

ai-ops

Guides operational excellence for AI/ML systems in production. Use when deploying models, managing inference infrastructure, monitoring model drift, or maintaining AI-powered features. Use when you need reliable, observable, and governable machine learning systems.

borhen68/SkillEngine · 50 tokens

chaos-engineering

Guides systematic fault injection and resilience testing. Use when designing for high availability, verifying disaster recovery, testing failure modes, or building fault-tolerant systems. Use when you need to prove your system survives infrastructure failures, network partitions, dependency outages, or cascading…

borhen68/SkillEngine · 59 tokens

ci-cd-and-automation

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

borhen68/SkillEngine · 45 tokens

context-engineering

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

borhen68/SkillEngine · 43 tokens