observability-and-instrumentation

Instruments production code with structured logs, metrics, traces, and symptom-based alerts.

665|3|Updated Sep 12, 2026
One-click install
npx skills add https://github.com/rizqinrr/viserys-agent --skill observability-and-instrumentation-rizqinrr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: observability-and-instrumentation
Source: https://github.com/rizqinrr/viserys-agent/tree/main/skills/observability-and-instrumentation
Command: npx skills add https://github.com/rizqinrr/viserys-agent --skill observability-and-instrumentation-rizqinrr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Production features often ship without telemetry, so when something breaks, engineers cannot tell what happened from the available data. This Skill guides you to instrument code alongside the feature so production behavior is visible, queryable, and diagnosable from day one. ## Core Features & Use Cases - Structured Logging: Enforces JSON log events with stable event names, mandatory correlation IDs, entry-point attribution, and consistent log levels, while blocking secrets and PII from log output. - Metrics and Tracing: Applies RED (Rate, Errors, Duration) and USE (Utilization, Saturation, Errors) patterns with bounded label cardinality, histogram-based latency percentiles, and OpenTelemetry distributed tracing with context propagation. - Alerting and Runbooks: Designs symptom-based alerts with page/ticket severities, thresholds, and linked runbooks, plus a verification step that test-fires alerts and confirms telemetry by inducing failures in staging. - Use Case: You are adding a payment retry flow with an external provider. The Skill walks you through defining on-call questions, emitting a payment_failed structured event, adding a latency histogram for provider calls, tracing the checkout across services, and paging only when the user-facing error rate crosses a threshold. ## Quick Start Use the observability-and-instrumentation skill to add structured logging, RED metrics, tracing, and an alert with a runbook 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 Node.js service?

Emit JSON log events with a stable event name and machine-readable fields instead of string interpolation. Create a child logger per request carrying a correlation ID, and propagate that ID across HTTP headers and queue metadata so one request can be reconstructed end to end.

What metrics should I track for an HTTP API?

Use the RED pattern: request rate, error rate, and duration as a histogram with p50/p95/p99 percentiles, for every endpoint and external dependency. Keep label sets bounded to route templates and status classes; never label metrics with user IDs or raw URLs.

Should I use OpenTelemetry or Prometheus for observability?

They serve different signals: OpenTelemetry is the vendor-neutral standard for traces and metrics collection, while Prometheus is a common metrics backend. The RED/USE and cardinality rules apply identically regardless of which backend you choose.

Why do high-cardinality metric labels cause problems?

Every unique label combination creates a separate time series, so labels like user IDs, request IDs, or error messages explode storage and query costs in the metrics backend. High-cardinality lookups belong in logs and traces, not metric labels.

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 ticket severity for degradations actionable within a week, and delete any alert whose correct response is to ignore it.

When should I not use this observability skill?

Do not use it to diagnose an active failure; use a debugging skill for that. It also does not cover performance profiling of measured slowness or launch-day monitoring checklists, which belong to separate workflows.