golang-observability

Instrument Go services with structured logging, Prometheus metrics, OpenTelemetry tracing, profiling, and alerting.

1|Updated Jun 2, 2026
One-click install
npx skills add https://github.com/VerifiedOrganic/onboard --skill golang-observability-verifiedorganic
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: golang-observability
Source: https://github.com/VerifiedOrganic/onboard/tree/main/.agents/skills/golang-observability
Command: npx skills add https://github.com/VerifiedOrganic/onboard --skill golang-observability-verifiedorganic

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Go services shipped without observability are black boxes in production: no way to diagnose latency spikes, error bursts, goroutine leaks, or slow dependencies. This Skill guides an AI agent to instrument Go code with the five production signals — logs, metrics, traces, profiles, and RUM — following proven conventions and avoiding common pitfalls like high-cardinality labels and missing trace context. ## Core Features & Use Cases - Structured logging with slog: JSON handlers for production, context-aware log calls for trace correlation, and incremental migration from zap, logrus, or zerolog via bridge handlers. - Prometheus metrics and alerting: correct metric types (Histogram over Summary), naming conventions, PromQL-as-comments above declarations, multi-window burn-rate SLO alerts, and Go runtime alerts for goroutine leaks and GC pressure. - OpenTelemetry tracing and profiling: span placement on service methods, DB queries, and external calls, context propagation, exemplars linking metrics to traces, and pprof/Pyroscope profiling toggled by environment variables. - Use Case: When adding a new HTTP endpoint to a Go service, ask the agent to make it observable — it will declare latency and error metrics with PromQL comments, add spans with error recording, emit structured context-aware logs, and wire alert rules. ## Quick Start Ask the agent to add production observability to your Go service, for example: instrument my HTTP handlers with Prometheus metrics, OpenTelemetry spans, and slog structured logging.

Frequently Asked Questions about golang-observability

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

FAQPage Schema
How do I add Prometheus metrics to a Go service?▼

Use the prometheus/client_golang library to declare Counters, Gauges, and Histograms with promauto, then expose them via promhttp.Handler on a /metrics endpoint. Prefer Histograms over Summaries for latency so percentiles can be aggregated across instances with histogram_quantile().

How do I correlate Go logs with OpenTelemetry traces?▼

Use the otelslog bridge from go.opentelemetry.io/contrib/bridges/otelslog as your slog handler, then always call the *Context variants like slog.InfoContext(ctx, ...). Trace_id and span_id are automatically injected into every log record.

Should I use Histogram or Summary for latency metrics in Prometheus?▼

Use a Histogram. Summaries compute quantiles client-side and cannot be aggregated across instances, while Histogram buckets are stored server-side and support histogram_quantile() queries across all replicas.

How do I migrate from zap or logrus to slog in Go?▼

Migrate incrementally in three steps: bridge slog output through the existing logger with samber/slog-zap or samber/slog-logrus, gradually replace call sites with slog.Info-style calls, then remove the bridge and the old dependency once migration is complete.

Why are high-cardinality labels dangerous in Prometheus?▼

Each unique label combination creates a separate time series, so unbounded values like user IDs or full URL paths cause memory explosion and slow queries on the Prometheus server. Use route templates and bounded values, and put high-cardinality data in traces instead.

When should I not use this observability skill?▼

It covers always-on production signals, not temporary deep-dive performance investigation. For one-off benchmarking or targeted performance analysis, use dedicated benchmark and performance skills instead.