observability-and-instrumentation

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

1|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/hafidzlvm/opencode --skill observability-and-instrumentation-hafidzlvm
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: observability-and-instrumentation
Source: https://github.com/hafidzlvm/opencode/tree/main/skills/observability-and-instrumentation
Command: npx skills add https://github.com/hafidzlvm/opencode --skill observability-and-instrumentation-hafidzlvm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires prom-client, @opentelemetry/sdk-node, @opentelemetry/auto-instrumentations-node.

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 the outside. ## Core Features & Use Cases - Structured Logging: Emit 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: Apply RED/USE metrics with bounded label cardinality and OpenTelemetry distributed tracing to answer rate, error, latency, and cross-service questions. - Symptom-Based Alerting and Runbooks: Create actionable alerts tied to user-facing symptoms, each linked to a minimal runbook, and verify telemetry by inducing failures in staging. - 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 provider calls, and an alert on error rate with a runbook link. ## Quick Start Use the observability-and-instrumentation skill to add structured logging, RED metrics, and tracing 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 means emitting JSON objects with stable event names and machine-readable fields instead of interpolated strings. Attach a correlation ID at the system boundary via a child logger, use consistent log levels, and never log secrets or full PII.

What metrics should I instrument for HTTP endpoints?▼

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

Should I use OpenTelemetry or Prometheus for instrumentation?▼

OpenTelemetry is the vendor-neutral standard for tracing and metrics, with auto-instrumentation for HTTP, gRPC, and common database clients. Prometheus prom-client is one common metrics backend; the RED/USE and cardinality rules apply identically either way.

Why should alerts be symptom-based instead of cause-based?▼

Symptom-based alerts fire exactly when users are hurt, such as error rate above 1% for five minutes, regardless of cause. Cause-based alerts on CPU or disk fire when nothing is wrong and miss unpredicted failures. Every alert must be actionable and link to a runbook.

When should I not use this observability skill?▼

Do not use it to diagnose a failure happening right now; that belongs to debugging and error recovery workflows. It also does not cover profiling measured slowness or launch-day monitoring checklists, which are handled by performance and shipping skills.