python-observability

Instrument Python applications with JSON logs, Prometheus metrics, and OpenTelemetry tracing.

6|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/archibate/archibate-skills --skill python-observability-archibate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-observability
Source: https://github.com/archibate/archibate-skills/tree/main/old-skills/redundant-skills/python-observability
Command: npx skills add https://github.com/archibate/archibate-skills --skill python-observability-archibate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Production Python applications often lack consistent, machine-readable logs, reliable metrics, and end-to-end traces, making it difficult to answer what happened, where it happened, and why without deploying new code or running time-consuming investigations.

Core Features & Use Cases

  • Structured Logging: Emit JSON logs with consistent fields for filtering, searching, and ease of ingestion into log systems.
  • Metrics with Prometheus: Collect bounded-cardinality counters, histograms, and gauges to track the four golden signals and drive alerts.
  • Distributed Tracing: Instrument code with OpenTelemetry spans and propagate correlation IDs across services for end-to-end request visibility.
  • Use Case: Instrument a FastAPI or background worker service to add JSON logs, Prometheus metrics, and OTLP tracing so that on-call engineers can rapidly triage latency spikes and error cascades.

Quick Start

Instrument your FastAPI application with JSON-structured logs, Prometheus metrics, and OpenTelemetry tracing by adding the provided logging configuration, a correlation-ID middleware, and metric decorators to your endpoints.

Frequently Asked Questions about python-observability

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

FAQPage Schema
How do I add structured logging and Prometheus metrics to a Python service?

To add structured logging and Prometheus metrics to a Python service, instrument the application with JSON log configurations, bounded-cardinality counters, and metric decorators to surface actionable telemetry for incidents.

What is the best way to implement distributed tracing in Python microservices?

The best way to implement distributed tracing in Python microservices is using OpenTelemetry spans and correlation ID middleware to propagate context across services for end-to-end request visibility.

How does correlation ID propagation work for debugging production issues?

Correlation ID propagation works by attaching a unique identifier to requests and passing it across services via OpenTelemetry spans, allowing on-call engineers to track end-to-end request visibility and triage error cascades.

Why do my Prometheus metrics cause high cardinality in Python applications?

Prometheus metrics cause high cardinality in Python applications when labels attach to unbounded values like user IDs, which this instrumentation avoids by strictly collecting bounded-cardinality counters, histograms, and gauges.

Do I need OpenTelemetry to instrument a Python background worker for observability?

You need OpenTelemetry to instrument a Python background worker for full observability, as it provides the spans required to propagate correlation IDs and trace execution paths alongside structured JSON logs and metrics.