# Observability and Instrumentation (observability-and-instrumentation)

> Instruments code with structured logs, RED/USE metrics, OpenTelemetry tracing, and symptom-based alerts with runbooks so production is diagnosable.

- Category: [Monitoring & Ops](https://www.myskills.tools/en/categories/monitoring-ops/)
- Source: Community · Addy Osmani
- Repository: https://github.com/addyosmani/agent-skills/tree/main/skills/observability-and-instrumentation (commit fe6f081)
- SKILL.md: https://github.com/addyosmani/agent-skills/blob/main/skills/observability-and-instrumentation/SKILL.md
- Install command: `npx skills add addyosmani/agent-skills --skill observability-and-instrumentation`
- License: MIT
- Compatible with: Claude Code, Codex, Cursor, Copilot, Gemini CLI
- Permissions: read-repo ✓, write-files ✓, shell ✓, network ✗
- Status: Scan passed
- A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.

## Core rule

Write down the questions on-call will ask before instrumenting; every signal must help answer one of them.

## Execution Phases

1. **Define working** — Write two to four questions on-call will ask about the feature as the basis for all telemetry.
2. **Logs and metrics** — Emit JSON logs with stable event names and correlation IDs and no secrets or PII; add RED metrics with bounded labels and histograms.
3. **Distributed tracing** — Use OpenTelemetry auto-instrumentation, add manual spans only around meaningful work, and propagate context across async boundaries.
4. **Alerts and runbooks** — Alert only on user-facing symptoms with two severities, page and ticket, each linked to a runbook in docs/runbooks/.
5. **Verify the telemetry** — In staging, force an error, send test traffic, follow one request end to end and test-fire each alert to check the output.

## Permissions (summarised from SKILL.md)

| Capability | Needed | Details |
|---|---|---|
| File writes | Required | Adds logging, metrics, tracing setup and alert rules to code, and writes runbooks under docs/runbooks/. |
| Command execution | Required | Runs the app or tests to trigger code paths and inspect the actual log and metric output. |
| Network outbound | Not required | The skill does not ask the agent to call external APIs; staging and tracing-UI checks are described as verification steps. |

## SKILL.md frontmatter (YAML)

```yaml
---
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.
---
```

Home: https://www.myskills.tools/en/ · URL: https://www.myskills.tools/en/skills/observability-and-instrumentation/
