Observability Instrumentation

Implement structured logging, metrics, and distributed tracing in Go.

21|2|Updated Oct 8, 2025
One-click install
npx skills add https://github.com/yaleh/meta-cc --skill observability-instrumentation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Observability Instrumentation
Source: https://github.com/yaleh/meta-cc/tree/main/.claude/skills/observability-instrumentation
Command: npx skills add https://github.com/yaleh/meta-cc --skill observability-instrumentation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill establishes a structured observability framework with structured logging, metrics instrumentation, and tracing patterns to diagnose issues faster.

Core Features & Use Cases

  • Structured logging: Context-rich, leveled logs with request IDs.
  • Metrics: Counters, gauges, and histograms for performance visibility.
  • Tracing: Distributed tracing with span context propagation.

Quick Start

Introduce a request-scoped logger, a metrics counter, and a trace span for a sample operation.

Frequently Asked Questions about Observability Instrumentation

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

FAQPage Schema
How do I add structured logging to my Go application?

Structured logging captures contextual fields and log levels in a machine-readable format. Use Go's slog package to emit leveled logs with request IDs and context propagation, enabling faster diagnosis of production issues across your system.

What's the difference between logs, metrics, and traces in observability?

Logs record discrete events with context; metrics measure aggregated performance (counters, gauges, histograms); traces follow requests across distributed services. Together, these three pillars provide complete visibility into system behavior and performance.

How do I implement distributed tracing across microservices?

Distributed tracing creates spans that track requests through multiple services by propagating context. Assign trace IDs to requests, create child spans for operations, and export them to collect end-to-end request paths and latency across your microservice architecture.

Can I expose metrics in Prometheus format from my application?

Yes. Instrument your application with counters, gauges, and histograms, then expose them via an HTTP endpoint in Prometheus text format. This enables Prometheus to scrape your metrics and integrate with monitoring and alerting systems.

Do I need to refactor existing logs to use structured logging?

Structured logging transforms unstructured logs into queryable, context-rich events. You can migrate incrementally by adopting slog for new code and gradually replacing printf-style logging, improving debuggability without a complete rewrite.