python-observability

Implement structured logging, Prometheus metrics, and OpenTelemetry tracing in Python applications.

38.6k|4.1k|Updated Jul 24, 2025
One-click install
npx skills add https://github.com/wshobson/agents --skill python-observability-wshobson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-observability
Source: https://github.com/wshobson/agents/tree/main/plugins/python-development/skills/python-observability
Command: npx skills add https://github.com/wshobson/agents --skill python-observability-wshobson

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires structlog, prometheus_client, opentelemetry-api, opentelemetry-sdk, httpx, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you instrument Python applications to gain deep insights into their behavior, enabling faster debugging and performance optimization in production environments.

Core Features & Use Cases

  • Structured Logging: Implement machine-readable JSON logs with consistent fields for powerful querying.
  • Four Golden Signals: Track latency, traffic, errors, and saturation for critical service metrics.
  • Correlation IDs: Propagate unique IDs across requests and logs for end-to-end tracing.
  • Use Case: When a critical API endpoint starts failing intermittently, use this Skill to analyze structured logs and traces to pinpoint the exact cause, identify the affected users, and understand the error's impact without redeploying code.

Quick Start

Configure structured logging for your Python application using structlog to output JSON.

Frequently Asked Questions about python-observability

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

FAQPage Schema
How do I implement structured logging in Python for production monitoring?

Structured logging in Python uses structlog to output machine-readable JSON logs with consistent fields, enabling powerful querying for real-time monitoring and faster debugging.

What's the best way to track the Four Golden Signals for Python microservices?

Track the Four Golden Signals in Python microservices by collecting metrics on latency, traffic, errors, and saturation using the prometheus_client library for performance analysis.

How do I propagate correlation IDs across Python distributed traces?

Propagate correlation IDs across Python distributed traces using OpenTelemetry to link unique IDs across requests and logs, providing end-to-end tracing for error diagnosis.

Can I use OpenTelemetry and Prometheus together for Python observability?

OpenTelemetry and Prometheus work together for Python observability by combining distributed tracing with custom metrics collection, addressing real-time monitoring and performance analysis needs.

Do I need structlog to instrument Python apps for observability?

Structlog is required to instrument Python apps for structured JSON logging, working alongside prometheus_client and opentelemetry-sdk to provide comprehensive application insights.

How does distributed tracing with OpenTelemetry help diagnose intermittent API failures?

Distributed tracing with OpenTelemetry diagnoses intermittent API failures by analyzing correlated traces and structured logs to pinpoint exact causes, identify affected users, and assess error impact.