observability-and-instrumentation

Add structured logging, metrics, tracing, and alerting to production code.

Updated Jul 21, 2026
One-click install
npx skills add https://github.com/afonsoft/gamehub --skill observability-and-instrumentation-afonsoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: observability-and-instrumentation
Source: https://github.com/afonsoft/gamehub/tree/main/.claude/skills/observability-and-instrumentation
Command: npx skills add https://github.com/afonsoft/gamehub --skill observability-and-instrumentation-afonsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Production features often ship without telemetry, turning every incident into guesswork. This Skill guides you to instrument code with structured logs, RED/USE metrics, distributed tracing, and symptom-based alerts so on-call engineers can answer what the system is doing and why. ## Core Features & Use Cases - Structured Logging: Enforces JSON log events with stable names, consistent levels, and mandatory correlation/request IDs, while blocking secrets and PII from log output. - Metrics and Tracing: Applies RED metrics for endpoints and dependencies, USE metrics for resources, histogram-based latency percentiles, and OpenTelemetry auto-instrumentation with context propagation. - Alerting and Verification: Designs symptom-based alerts with runbooks and two severities, plus a checklist to test-fire alerts and locate induced failures via telemetry alone. - Use Case: When adding a payment retry flow, use this Skill to define on-call questions, emit a payment_failed structured event, add provider latency histograms, and create an error-rate alert linked to a runbook. ## Quick Start Use the observability-and-instrumentation skill to add logging, metrics, tracing, and alerts to my new checkout endpoint.

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

Structured logging emits JSON objects with a stable event name and machine-readable fields instead of interpolated strings. Attach a correlation or request ID to every log line, use consistent error/warn/info/debug levels, and never log secrets, tokens, or unredacted PII.

What metrics should I instrument for an HTTP endpoint?▼

Use RED metrics: Rate, Errors, and Duration as a histogram with queryable p95/p99 percentiles. Labels must come from small fixed sets like route template and status class; never use user IDs, raw URLs, or error messages as labels.

How do I set up distributed tracing with OpenTelemetry?▼

Initialize the OpenTelemetry NodeSDK with auto-instrumentations before any other imports to cover HTTP, gRPC, and common database clients. Add manual spans only around meaningful units of work and propagate context across HTTP headers and queue message metadata.

Should alerts fire on CPU usage or error rates?▼

Alert on symptoms users feel, such as error rate above 1% or p99 latency breaches, not causes like CPU or disk usage. Every alert must be actionable, link to a runbook, and use only two severities: page for user-facing issues and ticket for degradation.

Why do high-cardinality metric labels cause problems?▼

Each unique label combination creates a separate time series, so labels like user IDs or full URLs explode storage and query costs in the metrics backend. Keep labels to small fixed sets and put high-cardinality values in logs and traces instead.

When should I not use this observability skill?▼

Do not use it to diagnose an active failure happening right now; that requires a debugging workflow. It also does not cover performance profiling of measured slowness or launch-day monitoring checklists, which belong to separate skills.