observability-and-instrumentation

Add structured logs, metrics, and distributed tracing to production code.

2|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/NAMEWTA/learning-open-code --skill observability-and-instrumentation-namewta
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: observability-and-instrumentation
Source: https://github.com/NAMEWTA/learning-open-code/tree/main/translator/open-ai-skills/addyosmani-agent-skills/skills/observability-and-instrumentation
Command: npx skills add https://github.com/NAMEWTA/learning-open-code --skill observability-and-instrumentation-namewta

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Production features often ship without telemetry, making incidents impossible to diagnose. This Skill guides you to instrument code with structured logs, RED/USE metrics, and OpenTelemetry tracing so on-call engineers can answer what the system is doing and why. ## Core Features & Use Cases - Structured Logging: Emit JSON log events with stable event names, correlation IDs, and safe field allowlists instead of string interpolation. - Metrics & Alerting: Implement RED metrics for endpoints and dependencies, avoid high-cardinality labels, and design symptom-based alerts with runbooks. - Distributed Tracing: Set up OpenTelemetry auto-instrumentation with context propagation across services and queues. - Use Case: When adding a payment retry flow, use this Skill to define on-call questions first, then add the exact logs, histograms, spans, and alerts needed to diagnose failures in production. ## Quick Start Use the observability-and-instrumentation skill to add structured logging, RED metrics, and OpenTelemetry tracing to my checkout service.

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 service?▼

Emit each log line as a JSON object with a stable event name and machine-readable fields instead of string interpolation. Attach a correlation ID via middleware so every log line, span, and outbound call for a request can be reconstructed.

What metrics should I track for HTTP endpoints?▼

Use the RED method: rate, errors, and duration as a histogram per endpoint and per external dependency. Track percentiles like p95 and p99 rather than averages, which hide the worst user experiences.

How do I set up distributed tracing with OpenTelemetry?▼

Import the OpenTelemetry NodeSDK with auto-instrumentations before any other code to cover HTTP, gRPC, and common database clients. Add manual spans only around meaningful work units and propagate context across async boundaries.

Why should user IDs never be metric labels?▼

High-cardinality labels like user IDs, raw URLs, or error messages create a separate time series per unique value, which can overload the metrics backend. Unbounded values belong in logs and traces; labels must come from small fixed sets.

When should alerts page someone versus create a ticket?▼

Alert on user-facing symptoms like error rate or p99 latency, not causes like CPU usage. Use page severity for issues needing immediate action and ticket severity for degradation actionable within the week.