Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Observability And Instrumentation

ASecurity

Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.

3 stars
0 votes
0 copies
2 views
Added 9/22/2026
ai-agentstypescriptgo

Works with

cli

Security Analysis

A100/100

Scanned 10/6/2026

$npx -y skills add oleg494/coding-kit --skill observability-and-instrumentation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Observability And Instrumentation?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Observability And Instrumentation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/oleg494-observability-and-instrumentation/badge)](https://www.skillsdirectory.com/skills/oleg494-observability-and-instrumentation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: observability-and-instrumentation
description: Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.
license: MIT
metadata:
  version: "4.7.0"
---

# Observability and Instrumentation

## Overview

Code you can't observe is code you can't operate. Instrumentation is not a post-launch add-on — it's written alongside the feature, the same way tests are.

## When to Use

- Building any feature that will run in production
- Adding a new service, endpoint, background job, or external integration
- A production incident took too long to diagnose
- Setting up or reviewing alerting rules

## Process

### 1. Define "working" before instrumenting

Write down 2–4 questions an on-call engineer will ask about this feature:

```
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?
3. Is the payment provider slower than usual?
→ Every signal below must help answer one of these.
```

### 2. Pick the right signal

| Signal | Answers | Cost |
|---|---|---|
| **Structured log** | "What happened in this specific case?" | Per-event |
| **Metric** | "How often / how fast, in aggregate?" | Fixed per series |
| **Trace** | "Where did time go across services?" | Per-request, sampled |

Rule: metrics tell you **that** something is wrong, traces tell you **where**, logs tell you **why**.

### 3. Structured logging

Log events, not prose. Every log line is a JSON object with a stable event name:

```typescript
// BAD: logger.info(`Payment ${id} failed for user ${userId}`);
// GOOD:
logger.warn({
  event: 'payment_failed',
  paymentId: id,
  provider: 'stripe',
  errorCode: err.code,
  attempt: n,
}, 'payment failed');
```

**Log levels:**
| Level | Meaning | On-call action |
|---|---|---|
| `error` | Invariant broken | Investigate |
| `warn` | Degraded but handled | Watch for trends |
| `info` | Significant business event | None |
| `debug` | Diagnostic detail | Off in production |

**Correlation IDs are mandatory.** Generate/accept a request ID at the system boundary and attach it to every log line, span, and outbound call.

**Never log secrets, tokens, passwords, or full PII.**

### 4. Metrics

Instrument **RED** on every endpoint: **R**ate, **E**rrors, **D**uration (histogram, not average).

**Cardinality is the failure mode.** Labels must come from small, fixed sets (route template, status class). Never use user IDs, raw URLs, or error messages as labels.

Track averages never, percentiles always. Use histograms: p50/p95/p99.

### 5. Distributed tracing

Use OpenTelemetry — vendor-neutral standard. Auto-instrumentation covers HTTP, gRPC, DB clients with near-zero code.

### 6. Alerting

Alert on **symptoms users feel**, not on causes:
- SYMPTOM (page-worthy): error rate > 1% for 5 min, p99 latency > 2s
- CAUSE (dashboard, not a page): CPU at 85%, one pod restarted

Rules for every alert:
1. It must be actionable
2. It links to a runbook
3. It has a threshold justified by SLO or historical data
4. Two severities only: **page** (act now) and **ticket** (act this week)

### 7. Verify the telemetry itself

Before calling done:
- Force an error in staging → find it in logs by requestId
- Send test traffic → confirm metric series appear
- Follow one request across services in tracing UI
- Fire each new alert once (lower threshold temporarily)

## Verification
- [ ] On-call questions written down, each signal maps to one
- [ ] All log output structured (JSON), correlation ID on every line
- [ ] No secrets in any log line
- [ ] RED metrics for every new endpoint, bounded label sets
- [ ] Latency is a histogram; p95/p99 queryable
- [ ] Every new alert is symptom-based, has a runbook link, was test-fired

Attribution

oleg494oleg494
View sourceSee grades on GitHubMore from oleg494 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →