go-observability

Integrate structured logging, OpenTelemetry tracing, and metrics into Go services.

64|9|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/eduardo-sl/go-agent-skills --skill go-observability-eduardo-sl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-observability
Source: https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/%28safety%29/go-observability
Command: npx skills add https://github.com/eduardo-sl/go-agent-skills --skill go-observability-eduardo-sl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Observability is essential for production Go services. It ensures structured logs, distributed tracing, and reliable metrics for monitoring, troubleshooting, and performance tuning.

Core Features & Use Cases

  • Structured logging with log/slog for context-rich events
  • Distributed tracing via OpenTelemetry across service boundaries
  • Metrics collection and health checks with Prometheus/OpenTelemetry
  • Safe, graceful shutdown of telemetry providers and propagation of trace context

Quick Start

Configure your Go services to emit structured logs, traces, and metrics with OpenTelemetry.

Frequently Asked Questions about go-observability

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

FAQPage Schema
How do I set up distributed tracing and structured logging in a Go microservice?

You enable end-to-end observability in Go services by integrating log/slog for structured logging and OpenTelemetry for distributed tracing across service boundaries. This provides context-rich events and reliable trace propagation.

What is the best way to collect metrics and health checks in Go services?

The best way to collect metrics and health checks in Go services is by using OpenTelemetry and Prometheus. This approach ensures metric naming conventions are followed and provides reliable performance monitoring for production environments.

Can I use OpenTelemetry tracing with Go background workers?

Yes, OpenTelemetry tracing can be used with Go background workers. The observability setup applies to HTTP handlers, background workers, and microservices, ensuring trace context propagation and telemetry collection across different execution models.

How do I ensure graceful shutdown of telemetry providers in Go?

Graceful shutdown of telemetry providers in Go is handled by safely flushing and closing OpenTelemetry and logging pipelines. This ensures all traces, metrics, and structured logs are properly exported before the service terminates.

Why do I need structured logs and trace context propagation in Go observability?

Structured logs and trace context propagation are needed in Go observability to correlate events across distributed service boundaries. Using log/slog and OpenTelemetry provides context-rich data essential for troubleshooting and performance tuning.