wshobson avatar

Python Observability

Sets up proper observability for Python apps when your production systems inevitably break and you need answers fast. Configures structlog for JSON logging with correlation IDs that thread through request chains, implements the four golden signals (latency, traffic, errors, saturation) with Prometheus metrics, and shows you how to instrument endpoints without creating cardinality explosions. The correlation ID propagation patterns alone will save you hours of log diving when tracking down distributed system failures. Focuses on the practical stuff that actually helps during 3am incidents.

skills.sh installs
12K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill python-observability --agent claude-code

Installs into .claude/skills of the current project.

Files

Python Observability

Instrument Python applications with structured logs, metrics, and traces. When something breaks in production, you need to answer "what, where, and why" without deploying new code.

When to Use This Skill

  • Adding structured logging to applications
  • Implementing metrics collection with Prometheus
  • Setting up distributed tracing across services
  • Propagating correlation IDs through request chains
  • Debugging production issues
  • Building observability dashboards

Core Concepts

1. Structured Logging

Emit logs as JSON with consistent fields for production environments. Machine-readable logs enable powerful queries and alerts. For local development, consider human-readable formats.

2. The Four Golden Signals

Track latency, traffic, errors, and saturation for every service boundary.

3. Correlation IDs

Thread a unique ID through all logs and spans for a single request, enabling end-to-end tracing.

4. Bounded Cardinality

Keep metric label values bounded. Unbounded labels (like user IDs) explode storage costs.

Quick Start

import structlog

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
DevOps & CI/CD, Debugging, Python

More from wshobson/agents

All 174
1callstackincubator avatargithub-actionscallstackincubator/agent-skillsGitHub Actions workflow patterns for React Native iOS simulator and Android emulator cloud builds with downloadable artifacts. Use when setting up CI build pipe12Kskills.sh installs
2wshobson avatark8s-manifest-generatorwshobson/agentsCreate production-ready Kubernetes manifests for Deployments, Services, ConfigMaps, and Secrets following best practices and security standards. Use when genera11.6Kskills.sh installs
3wshobson avatarml-pipeline-workflowwshobson/agentsBuild end-to-end MLOps pipelines from data preparation through model training, validation, and production deployment. Use when creating ML pipelines, implementi11.5Kskills.sh installs
4wshobson avatarservice-mesh-observabilitywshobson/agentsImplement comprehensive observability for service meshes including distributed tracing, metrics, and visualization. Use when setting up mesh monitoring, debuggi10.7Kskills.sh installs
5anthropics avatarbuild-dashboardanthropics/knowledge-work-pluginsBuild an interactive HTML dashboard with charts, filters, and tables. Use when creating an executive overview with KPI cards, turning query results into a share9.4Kskills.sh installs
6aws avataraws-cloudformationaws/agent-toolkit-for-awsAuthor, validate, and troubleshoot AWS CloudFormation templates. Covers template authoring with secure defaults, pre-deployment validation (cfn-lint, cfn-guard,9.4Kskills.sh installs