golang-observability

Wire structured logs, Prometheus metrics, OpenTelemetry traces, profiling, and RUM in Go services.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/osmanozen/go-commerce --skill golang-observability-osmanozen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-observability
Source: https://github.com/osmanozen/go-commerce/tree/main/.agents/skills/golang-observability
Command: npx skills add https://github.com/osmanozen/go-commerce --skill golang-observability-osmanozen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Instrument Go services to achieve end-to-end observability by wiring logs, metrics, traces, profiling, and RUM, with practical patterns and migration guidance.

Core Features & Use Cases

  • Five signals framework: logs, metrics, traces, profiling, and RUM to diagnose production issues across replicas.
  • Migration and onboarding guides: step-by-step paths to adopt slog, otelslog bridges, and OpenTelemetry instrumentation without breaking existing code.
  • Production-ready templates: reusable patterns for request timing, context propagation, and correlation across services, plus alerting and dashboards.

Quick Start

Instrument a Go service by enabling slog-based JSON logging, add OpenTelemetry tracing via otelhttp transport for outgoing calls, and expose a Prometheus histogram for request latency.

Frequently Asked Questions about golang-observability

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

FAQPage Schema
How do I set up end-to-end observability in a Go service using slog and OpenTelemetry?

End-to-end observability in a Go service is set up by wiring structured JSON logs via slog, adding OpenTelemetry tracing with otelhttp, and exposing Prometheus histograms for request latency. This blueprint connects logs, metrics, and traces across replicas.

Can I migrate my existing Go logging from zap or logrus to slog without breaking code?

Yes, you can migrate Go logging from zap, logrus, or zerolog to slog without breaking existing code. The blueprint provides step-by-step migration guides and integrates otelslog bridges to maintain context-aware structured logging.

What is the best way to propagate OpenTelemetry traces across multiple Go microservices?

The best way to propagate OpenTelemetry traces across multiple Go microservices is by applying otelhttp transport instrumentation for outgoing calls. This ensures trace context propagation and correlation across replicas.

How do I enable on-demand profiling in Go production services?

On-demand profiling in Go production services is enabled via environment variable toggles. This allows you to activate profiling controls dynamically to diagnose latency issues without redeploying.

Does this Go observability blueprint include Real User Monitoring and alerting setup?

Yes, the Go observability blueprint includes privacy-conscious Real User Monitoring (RUM) integration and provides production-ready templates for alerting and dashboards to ensure readiness.

When should I use a histogram for Prometheus metrics in Go applications?

You should use a histogram for Prometheus metrics in Go applications to track request latency and timing distributions. The blueprint provides reusable patterns for declaring metrics with histogram-based latency monitoring.