logging-observability

Implement structured JSON logging and distributed tracing with OpenTelemetry.

53|1|Updated Dec 18, 2025
One-click install
npx skills add https://github.com/cosmix/claude-code-setup --skill logging-observability
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logging-observability
Source: https://github.com/cosmix/claude-code-setup/tree/main/skills/logging-observability
Command: npx skills add https://github.com/cosmix/claude-code-setup --skill logging-observability

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill covers structured logging, distributed tracing, metrics, and alerting patterns for production systems.

Core Features & Use Cases

  • Structured Logging: JSON logs with correlation IDs and context.
  • Tracing & Metrics: OpenTelemetry integration and dashboards.
  • Alerts: Design alert rules and runbooks.

Quick Start

Implement a simple JSON-formatted logger with correlation IDs across requests.

Frequently Asked Questions about logging-observability

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement structured logging with JSON format and correlation IDs?

Structured logging outputs JSON-formatted logs with embedded correlation IDs to track requests across services. This enables unified log aggregation, easier parsing by monitoring systems, and automatic correlation of related events in distributed systems without manual log tailing.

What's the difference between logging, metrics, and distributed tracing?

Logging captures discrete events as JSON records; metrics aggregate numerical data over time; tracing follows request paths across services with spans and timing. Together they form complete observability, with logs for debugging, metrics for trends, and traces for understanding latency and dependencies.

Can I use OpenTelemetry for logging, metrics, and traces together?

OpenTelemetry provides unified APIs and SDKs for all three signals—logs, metrics, and traces—enabling a single instrumentation approach. This eliminates vendor lock-in and allows you to export all telemetry to the same backend or split across multiple compatible systems.

How do I propagate trace context across microservices?

Trace propagation embeds correlation IDs and span context in request headers or message metadata so each service links its logs and spans to the same logical request. OpenTelemetry handles this automatically, creating an end-to-end trace across your microservice architecture.

Does structured logging work with batch processing and event-driven systems?

Structured logging applies to any architecture—microservices, batch jobs, and event-driven systems all benefit from JSON logs with correlation IDs. Batch tasks and event handlers can emit structured logs and propagate trace context, giving operators visibility into asynchronous and long-running workloads.

How do I set up alerts based on logs and metrics?

Alert rules query metrics thresholds or log patterns and trigger notifications and runbooks when conditions are met. Structured metrics and JSON logs integrate directly with alerting pipelines, enabling operators to define clear escalation policies and automated remediation workflows.