What problem does it solve?
This Skill helps Python developers achieve end-to-end observability by providing structured logging, metrics, and distributed tracing, enabling faster diagnosis of production issues without invasive changes.
Core Features & Use Cases
- Structured Logging: emit JSON logs with consistent fields for correlation and filtering.
- Metrics & Tracing: collect Prometheus-compatible metrics and OpenTelemetry traces to monitor performance and service interactions.
- Use Case: when debugging a running service, instrument code to capture request latency, errors, and throughput, and correlate across services.
Quick Start
Install and configure the recommended libraries (e.g., structlog, prometheus_client, and opentelemetry) and provide a minimal example to initialize logging, metrics, and tracing. Example (plain text):
import logging
import structlog
from prometheus_client import start_http_server
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.exporter.otlp.proto.grpc.exporter import OTLPSpanExporter
from opentelemetry.sdk.trace.export import BatchSpanProcessor
Initialize logging
structlog.configure(...)
logging.basicConfig(level="INFO")
logger = structlog.get_logger()
Start metrics server
start_http_server(8000)
Configure tracing
provider = TracerProvider()
processor = BatchSpanProcessor(OTLPSpanExporter(endpoint="http://localhost:4317"))
provider.add_span_processor(processor)
trace.set_tracer_provider(provider)
tracer = trace.get_tracer(name)
logger.info("Observability initialized")