opentelemetry-go

Instrument Go applications with OpenTelemetry for traces, metrics, and OTLP export.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/cedricziel/claude-otel-plugin --skill opentelemetry-go
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opentelemetry-go
Source: https://github.com/cedricziel/claude-otel-plugin/tree/main/.claude/skills/opentelemetry-go
Command: npx skills add https://github.com/cedricziel/claude-otel-plugin --skill opentelemetry-go

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go developers often struggle to observe production behavior. This Skill provides structured guidance to instrument Go applications with OpenTelemetry, enabling traces, metrics, and context propagation.

Core Features & Use Cases

  • Manual instrumentation patterns with the OpenTelemetry Go API and Contrib libraries
  • SDK configuration and resource setup (service.name, version, etc.)
  • HTTP server and gRPC instrumentation (automatic and manual)
  • Context propagation across goroutines and asynchronous work
  • Exporting traces and metrics to OTLP endpoints for centralized observability

Quick Start

Set up a Go module, install OpenTelemetry libraries, initialize a TracerProvider, configure an OTLP exporter, and generate a sample span.

Frequently Asked Questions about opentelemetry-go

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

FAQPage Schema
How do I add tracing and metrics to a Go application?

Tracing and metrics in Go require manual instrumentation using the OpenTelemetry Go API and Contrib libraries. Install the packages, initialize a TracerProvider with an OTLP exporter, create spans around operations, and configure resource attributes like service name to identify your application in observability platforms.

What's the best way to instrument HTTP servers and gRPC services with OpenTelemetry?

OpenTelemetry provides automatic and manual instrumentation patterns for HTTP and gRPC. Use Contrib middleware for automatic tracing, or manually create spans in handlers. Configure an OTLP exporter to send traces to a collector, and propagate context across requests to maintain trace correlation.

How do I propagate context across goroutines in Go applications?

Context propagation in Go ensures trace correlation across concurrent operations. Pass context.Context through goroutine calls, use OpenTelemetry's context APIs to attach and extract span data, and configure your OTLP exporter to export the linked traces for end-to-end observability.

Can I use OpenTelemetry to instrument database queries and async work in Go?

Yes. OpenTelemetry supports instrumentation of databases and asynchronous operations through the Go API and Contrib libraries. Create spans around database calls and async tasks, propagate context through goroutines, and export telemetry via OTLP to monitor latency and errors across all components.

Do I need to set up an OTLP endpoint to use OpenTelemetry in Go?

An OTLP exporter endpoint is required to export traces and metrics from your Go application. You must configure the exporter in code with the endpoint address. This sends telemetry to a collector or observability backend for centralized storage and analysis.

What's required to start instrumenting a Go service with OpenTelemetry?

Start by setting up a Go module, installing OpenTelemetry Go API and Contrib libraries, initializing a TracerProvider with resource attributes, and configuring an OTLP exporter. Generate a sample span to verify the setup, then instrument your HTTP servers, databases, and goroutines.