observability-skill

Generate structured logging, metrics, and distributed tracing code for Python services.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/tendercoconut174/ai-agent-platform --skill observability-skill-tendercoconut174
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: observability-skill
Source: https://github.com/tendercoconut174/ai-agent-platform/tree/main/.cursor/skills/observability-skill
Command: npx skills add https://github.com/tendercoconut174/ai-agent-platform --skill observability-skill-tendercoconut174

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding consistent, production-appropriate observability to a service is error-prone: developers often emit unstructured logs, leak secrets into log output, or forget to propagate trace context across service boundaries. This Skill provides concrete rules and code patterns for logging, metrics, and tracing so generated code follows a consistent observability standard. ## Core Features & Use Cases - Structured Logging: Enforces JSON or key-value log formats with contextual fields like request_id, task_id, and service, using the standard logging library or structlog. - Metrics Guidance: Defines counters for task status, queue depth, and processing latency using OpenTelemetry or Prometheus with consistent namespacing. - Distributed Tracing: Propagates trace IDs across gateway, queue, and worker components and correlates logs with trace IDs for debugging. - Use Case: When debugging a production issue in an AI agent platform, use this Skill to add structured logs with task_id context and trace propagation so you can follow a single request across the gateway, queue, and worker. ## Quick Start Add structured logging with request_id and task_id context plus OpenTelemetry tracing to my Python worker service.

Frequently Asked Questions about observability-skill

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

FAQPage Schema
How do I add structured logging in Python?▼

Use the standard logging library or structlog to emit JSON or key-value log records. Attach contextual fields like request_id, task_id, and service via the extra parameter so every log line is searchable and correlated.

What metrics should I track for a task queue worker?▼

Track task counts by status such as success, failure, and timeout, plus queue depth and processing latency. Use OpenTelemetry or Prometheus and keep metric names consistent and namespaced.

How do I propagate trace IDs across microservices?▼

Use OpenTelemetry to propagate trace context across the gateway, queue, and worker components. Include the trace ID in log records so logs and spans can be correlated when debugging a single request.

What should never be included in application logs?▼

Never log secrets, tokens, or full PII. Log only operational context such as request_id, task_id, service name, and duration, and use appropriate levels like DEBUG, INFO, WARNING, and ERROR.

structlog vs standard logging library for structured logs?▼

Both are supported for structured logging. The standard logging library works with the extra parameter for key-value context, while structlog provides a more structured pipeline for JSON output out of the box.