logging-observability

Implement structured JSON logging with correlation IDs across async boundaries.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/jrmatherly/metorial-workspace --skill logging-observability-jrmatherly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logging-observability
Source: https://github.com/jrmatherly/metorial-workspace/tree/main/.github/skills/logging-observability
Command: npx skills add https://github.com/jrmatherly/metorial-workspace --skill logging-observability-jrmatherly

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides structured JSON logging with correlation IDs and robust context propagation across asynchronous boundaries, enabling consistent, machine-readable logs that are easy to search and analyze in distributed systems.

Core Features & Use Cases

  • Structured Logging: JSON-formatted logs enriched with correlation_id, user_id, request_path, and other context data.
  • Context Propagation: Seamless metadata propagation across async boundaries in Python (contextvars) and TypeScript (AsyncLocalStorage).
  • Performance Timing: Decorators to measure and log operation durations for critical paths and slow operations.
  • Worker Metrics: Utilities to collect and propagate metrics for background jobs and workers.
  • Cross-Llexibility: Consistent logging approach across languages (Python and TypeScript) for unified observability.

Quick Start

Initialize the logging context in your application, then use the provided logger to emit structured logs. Generate or propagate a correlation ID for each request or job, wrap functions with the timing decorators where needed, and use the context-aware loggers to produce consistent, traceable logs across services and workers.

Frequently Asked Questions about logging-observability

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

FAQPage Schema
How do I propagate a correlation ID across async boundaries in Python and TypeScript?

JSON logging provides machine-readable logs enriched with correlation_id, user_id, and request_path, making structured logs easy to search and analyze in distributed systems compared to flat text formats.

How do I add performance timing to critical API paths and slow operations?

Python uses contextvars and TypeScript uses AsyncLocalStorage for context propagation, enabling seamless metadata propagation across async boundaries in both languages for unified observability.

Can I use structured logging for background workers and distributed services?

You initialize the logging context, generate a correlation ID for each request or job, wrap functions with timing decorators, and emit structured JSON logs using the context-aware logger.

Why do I need context propagation for observability in distributed systems?

Yes, a consistent logging approach applies across both Python and TypeScript, enabling unified observability and structured JSON logging across distributed services written in different languages.