observability-and-instrumentation

Instruments production code with structured logs, metrics, traces, and symptom-based alerts.

2|Updated Jul 11, 2026
One-click install
npx skills add https://github.com/MoofonLi/dev-ready --skill observability-and-instrumentation-moofonli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: observability-and-instrumentation
Source: https://github.com/MoofonLi/dev-ready/tree/main/src/dev_ready/templates/claude/skills/observability-and-instrumentation
Command: npx skills add https://github.com/MoofonLi/dev-ready --skill observability-and-instrumentation-moofonli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Production features often ship without telemetry, so when incidents occur engineers cannot tell what happened from the available data. This Skill guides you to instrument code alongside the feature so production behavior is visible, queryable, and diagnosable. ## Core Features & Use Cases - Structured Logging: Emits JSON log events with stable event names, consistent log levels, and mandatory correlation/request IDs, while keeping secrets and PII out of log pipelines. - Metrics and Tracing: Applies RED (Rate, Errors, Duration) and USE (Utilization, Saturation, Errors) methods with bounded label cardinality, histogram-based percentiles, and OpenTelemetry distributed tracing with context propagation. - Symptom-Based Alerting: Defines actionable alerts tied to user-facing symptoms with runbook links, thresholds, and two severity tiers, plus a verification pass that test-fires alerts and traces requests end-to-end. - Use Case: When adding a payment retry flow with external provider calls, use this Skill to define the on-call questions first, then add structured payment_failed events, provider latency histograms, and an error-rate alert before shipping. ## Quick Start Ask your agent to use the observability-and-instrumentation skill to add structured logging, RED metrics, tracing, and alerts to the new checkout endpoint before it ships.

Frequently Asked Questions about observability-and-instrumentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add structured logging to a Node.js application?

Emit JSON log events with stable event names and machine-readable fields instead of string interpolation. Attach a correlation ID at the request boundary via middleware and use a child logger per request so every line can be traced back to one request.

What metrics should I track for an HTTP API?

Use the RED method: Rate, Errors, and Duration for every endpoint and external dependency. Track latency as a histogram so p95 and p99 percentiles are queryable, and keep label sets bounded to route templates and status classes.

Does OpenTelemetry work with Express and database clients?

Yes, OpenTelemetry auto-instrumentation covers HTTP, gRPC, and common database clients with near-zero code. Initialize the NodeSDK with getNodeAutoInstrumentations before importing anything else, then add manual spans only around meaningful internal units of work.

Why should I avoid user IDs as metric labels?

Every unique label combination creates a separate time series, so unbounded values like user IDs, raw URLs, or error messages cause cardinality explosions that overwhelm the metrics backend. High-cardinality lookups belong in logs and traces instead.

When should I alert on symptoms instead of causes?

Alert on user-facing symptoms like error rate above 1% or p99 latency above 2 seconds, since cause-based alerts like CPU usage fire when nothing is wrong and miss unpredicted failures. Every alert must be actionable, link a runbook, and have a justified threshold.

When is this observability skill not the right tool?

It is not for diagnosing an active failure, which belongs to debugging workflows, nor for profiling measured slowness, which belongs to performance optimization. It covers the instrumentation written alongside features that makes those later investigations fast.