observability-and-instrumentation

Instruments production code with structured logging, metrics, tracing, and alerting.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/authrain-cloud-abdullahformuli/agent-skills --skill observability-and-instrumentation-authrain-cloud-abdullahformuli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: observability-and-instrumentation
Source: https://github.com/authrain-cloud-abdullahformuli/agent-skills/tree/main/skills/observability-and-instrumentation
Command: npx skills add https://github.com/authrain-cloud-abdullahformuli/agent-skills --skill observability-and-instrumentation-authrain-cloud-abdullahformuli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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 and diagnosable from day one. ## Core Features & Use Cases - Structured Logging: Emits JSON log events with stable event names, correlation IDs, and entry-point attribution, while keeping secrets and PII out of log pipelines. - Metrics and Tracing: Applies RED/USE metric patterns with bounded label cardinality and OpenTelemetry distributed tracing with context propagation across services. - Symptom-Based Alerting: Creates actionable alerts tied to user-facing symptoms, each linked to a runbook, and verifies telemetry by triggering real failure paths. - Use Case: When adding a payment retry flow with a queue and an external provider, use this Skill to define the on-call questions, add structured logs with request IDs, RED metrics on the provider calls, traces across services, and an alert on elevated failure rate with a runbook. ## Quick Start Instrument my new checkout endpoint with structured logging, RED metrics, OpenTelemetry tracing, and a symptom-based alert with a runbook.

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?

Structured logging emits JSON objects with a stable event name and machine-readable fields instead of interpolated strings. Attach a child logger per request carrying a correlation ID, and use consistent levels: error for broken invariants, warn for handled degradation, info for business events.

What metrics should I track for an HTTP API?

Use the RED method for request-driven services: rate, errors, and duration as a histogram with p50/p95/p99 percentiles. For resources like queues and pools, use USE: utilization, saturation, and errors. Keep label values from small fixed sets to avoid cardinality explosions.

How do I set up distributed tracing with OpenTelemetry?

Initialize the OpenTelemetry NodeSDK with auto-instrumentations before importing anything else, which covers HTTP, gRPC, and common database clients. Add manual spans around meaningful internal work and propagate context across HTTP headers and queue message metadata.

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 identifiers belong in logs and traces instead.

When should an alert page someone versus create a ticket?

Page only for user-facing symptoms requiring immediate action, such as error rate above 1% for five minutes. Use tickets for degradations actionable within the week. Every alert needs a threshold, a duration, and a linked runbook, and cause-based alerts like CPU usage belong on dashboards.