observability-and-instrumentation

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

Updated Aug 15, 2026
One-click install
npx skills add https://github.com/jacksonlee-tw/mystock-vue --skill observability-and-instrumentation-jacksonlee-tw
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: observability-and-instrumentation
Source: https://github.com/jacksonlee-tw/mystock-vue/tree/main/mystock-vue/.agents/skills/observability-and-instrumentation
Command: npx skills add https://github.com/jacksonlee-tw/mystock-vue --skill observability-and-instrumentation-jacksonlee-tw

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 and diagnosable from day one. ## Core Features & Use Cases - Structured Logging: Emit JSON log events with stable event names, correlation IDs, and entry-point attribution instead of unqueryable prose. - Metrics and Tracing: Apply RED/USE metrics with bounded label cardinality and OpenTelemetry distributed tracing across services. - Symptom-Based Alerting: Create actionable alerts tied to user-facing symptoms, each linked to a minimal runbook. - Use Case: When adding a payment retry flow, define the on-call questions first, then add a payment_failed structured log event, a latency histogram for the provider, trace spans around the charge call, and an alert on elevated error rate. ## Quick Start Use the observability-and-instrumentation skill to add logging, metrics, tracing, and an alert for the 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 Node.js application?▼

Structured logging emits JSON objects with a stable event name and machine-readable fields instead of interpolated strings. Create a child logger per request carrying a correlation ID, and attach fields like error codes and attempt counts so logs are queryable.

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 are queryable, and keep label sets bounded to values like route templates and status classes.

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 metadata.

Why should I avoid user IDs as metric labels?▼

High-cardinality labels like user IDs, raw URLs, or error messages create a separate time series per unique value, which can overwhelm the metrics backend. Keep labels to small fixed sets and put unbounded values in logs and traces instead.

When should an alert page someone versus create a ticket?▼

Page only for user-facing symptoms that need immediate action, such as elevated error rate or p99 latency breaching the SLO. Use ticket severity for degradations that can wait, and delete any alert whose correct response is to ignore it.