observability-and-instrumentation

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

2|Updated Jul 1, 2026
One-click install
npx skills add https://github.com/Lazare-Panam/mars-api --skill observability-and-instrumentation-lazare-panam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: observability-and-instrumentation
Source: https://github.com/Lazare-Panam/mars-api/tree/main/Mars.API/.claude/skills/observability-and-instrumentation
Command: npx skills add https://github.com/Lazare-Panam/mars-api --skill observability-and-instrumentation-lazare-panam

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 through instrumenting code with structured logs, metrics, distributed traces, and symptom-based alerts so production behavior is visible and diagnosable. ## Core Features & Use Cases - Structured Logging: Enforces JSON log events with stable event names, consistent log levels, mandatory correlation IDs, and redaction of secrets and PII. - Metrics and Tracing: Applies RED/USE metric patterns with bounded label cardinality, histogram-based latency percentiles, and OpenTelemetry auto-instrumentation for distributed tracing. - Alerting and Verification: Designs symptom-based alerts with runbooks and severities, then verifies telemetry by inducing failures in staging. - Use Case: When adding a payment retry flow, use this Skill to define the on-call questions first, then add structured payment_failed log events, RED metrics on the provider calls, and an alert on elevated error rate before shipping. ## Quick Start Ask the AI to review your new production feature and add structured logging, RED metrics, tracing, and alerts following the observability checklist.

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 log events with stable event names and machine-readable fields instead of string-interpolated prose. Attach a correlation ID at the system boundary, use consistent log levels, and never log secrets, tokens, or full PII.

What metrics should I add for HTTP endpoints and external dependencies?

Use the RED pattern: rate, errors, and duration as a latency histogram for every endpoint and external dependency. For resources like queues and pools, use USE: utilization, saturation, and errors. Keep label cardinality bounded to small fixed sets like route templates and status classes.

Should I use OpenTelemetry or Prometheus for instrumentation?

OpenTelemetry is the vendor-neutral standard for tracing and metrics, with auto-instrumentation covering 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 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 lookups belong in logs and traces instead.

When should I not use this observability skill?

Do not use it to diagnose an active failure; that belongs to debugging and error recovery workflows. It also does not cover performance profiling of measured slowness or launch-day monitoring checklists, which are separate concerns.