observability

Implements metrics, tracing, logging, and health checks for production services.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/Dazlarus/karl-code --skill observability-dazlarus
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: observability
Source: https://github.com/Dazlarus/karl-code/tree/main/.agents/skills/observability
Command: npx skills add https://github.com/Dazlarus/karl-code --skill observability-dazlarus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Production services often lack the instrumentation needed to diagnose failures, measure performance, and detect regressions, leaving teams blind when incidents occur. ## Core Features & Use Cases - Structured Metrics: Add Prometheus counters, histograms, and gauges with labels to endpoints and business logic. - Distributed Tracing & Correlation: Instrument request flows with OpenTelemetry spans and correlation ID middleware for cross-service debugging. - Health Checks, Error Tracking & Alerting: Implement liveness/readiness endpoints, Sentry integration, and Prometheus alerting rules. - Use Case: When building a FastAPI service, apply this Skill to add request metrics, tracing spans, health check endpoints, and alerting rules before deploying to production. ## Quick Start Review my FastAPI service and add Prometheus metrics, OpenTelemetry tracing, correlation IDs, and health check endpoints.

Frequently Asked Questions about observability

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

FAQPage Schema
How do I add Prometheus metrics to a FastAPI endpoint?▼

Define Counter, Histogram, and Gauge metrics with labels, then increment or observe them inside endpoint handlers. Use histogram context managers like request_duration.labels(...).time() to measure latency per endpoint.

How to implement distributed tracing with OpenTelemetry in Python?▼

Create a tracer with trace.get_tracer and wrap operations in start_as_current_span blocks, setting attributes like user_id and status_code. Instrument HTTP clients with AioHttpClientInstrumentor for automatic span propagation.

What is a correlation ID and how do I add one?▼

A correlation ID links logs and traces for a single request across services. Add middleware that reads or generates an X-Correlation-ID header, stores it on request state, sets it as a span attribute, and returns it in the response.

Does high trace sampling affect application performance?▼

Yes, over-sampling traces adds overhead in production. Use a low traces_sample_rate such as 0.1 in Sentry or OpenTelemetry configuration to balance visibility with performance impact.

When should I not add full observability instrumentation?▼

Skip full observability for simple local scripts and development-only features where metrics, tracing, and alerting add complexity without operational value. Reserve it for production services and APIs.