python-observability

Configure structlog, OpenTelemetry, and Prometheus for Python application observability.

6|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill python-observability-repairyourtech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-observability
Source: https://github.com/RepairYourTech/cfsa-antigravity/tree/main/.agent/skill-library/stack/observability/python-observability
Command: npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill python-observability-repairyourtech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires structlog, opentelemetry-sdk, opentelemetry-exporter-otlp, prometheus-client, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the setup and configuration of robust observability for Python applications, ensuring better logging, tracing, and metrics collection.

Core Features & Use Cases

  • Structured Logging: Integrates structlog for powerful, JSON-based logging.
  • Distributed Tracing: Configures OpenTelemetry for tracing requests across services.
  • Metrics Exposition: Sets up the Prometheus client for monitoring application performance.
  • Use Case: You need to add detailed, searchable logs and performance traces to your new FastAPI microservice to quickly diagnose issues in production.

Quick Start

Configure structlog for structured logging in your Python application.

Frequently Asked Questions about python-observability

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

FAQPage Schema
How do I set up structured logging and distributed tracing in a FastAPI application?

You can set up structured logging and distributed tracing in a FastAPI application by integrating structlog for JSON logging and OpenTelemetry for auto-instrumentation. This combination provides comprehensive observability to quickly diagnose production issues.

What is the best way to manage correlation IDs in asynchronous Python contexts?

The best way to manage correlation IDs in asynchronous Python contexts is using structlog combined with OpenTelemetry. This ensures trace context is properly propagated across async operations for correlated logs and distributed traces.

Does this observability setup support both Flask and FastAPI web frameworks?

Yes, this observability setup supports both Flask and FastAPI web frameworks. OpenTelemetry provides auto-instrumentation for these frameworks, automatically capturing incoming requests and generating distributed traces without requiring manual span creation.

Can I expose Prometheus metrics alongside OpenTelemetry tracing in Python?

Yes, you can expose Prometheus metrics alongside OpenTelemetry tracing in Python. This setup integrates the Prometheus client for metrics exposition while simultaneously using OpenTelemetry to collect distributed traces and application performance data.

How do I create custom spans for OpenTelemetry distributed tracing in Python?

To create custom spans for OpenTelemetry distributed tracing in Python, use the OpenTelemetry SDK to define specific operations within your application. This allows you to capture detailed performance traces beyond automatic web framework instrumentation.