# Ollygarden otel go setup

> Ollygarden otel go setup is an open-source agent skill for developer tools. Sets up OpenTelemetry tracing, metrics and logs in a Go service via a YAML config. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ollygarden/skills/tree/main/deprecated/ollygarden-otel-go-setup
- **Repository:** https://github.com/ollygarden/skills
- **GitHub stars:** 5
- **License:** Apache-2.0
- **Skill name:** ollygarden-otel-go-setup
- **Collection:** https://github.com/ollygarden/skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill gives an agent a recommended layout for wiring the OpenTelemetry SDK into a Go service using the otelconf package. It describes a telemetry package with a Providers struct that exposes tracer, meter and logger providers, a zap logger that tees structured JSON to stdout and forwards records through an OTel log bridge, and a shutdown hook with a bounded timeout.

The setup reads an external YAML file, expands environment variables in it, and adds service.version and a generated service.instance.id to the resource. If the config file is missing, it falls back to no-op providers so the application still runs. The skill also includes a checklist for request context threading into database calls, keeping SQL parameter values out of telemetry, keeping the resource attributes minimal, and honoring standard OTEL_* environment variables.

The skill expects a Go project using zap for logging and, for the database checks, GORM or database/sql. It ships no scripts and includes a verification report template the agent is asked to fill with observed results from its own run.

## When your agent uses it

> Ollygarden's recommended pattern for setting up the OpenTelemetry SDK in Go services using otelconf. Covers project structure, the Providers struct, no-op fallback, runtime attribute injection, and the zap log bridge. Use when adding OTel to a Go project, structuring telemetry code, or reviewing an existing setup — including when DB spans show up as trace roots or GORM/database spans are disconnected from HTTP spans. Triggers on "go otel setup", "go telemetry pattern", "Providers struct go otel", "gorm WithContext", "root client span go".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ollygarden/skills/tree/HEAD/deprecated/ollygarden-otel-go-setup)
- [License: Apache-2.0](https://github.com/ollygarden/skills/tree/HEAD/deprecated/ollygarden-otel-go-setup)

## Features

- **Declarative SDK configuration:** Loads exporters, processors and sampling from a YAML file parsed with otelconf rather than hand-built code.
- **No-op fallback:** Continues running with no-op tracer, meter and logger providers when the config file is absent.
- **Providers struct pattern:** Groups tracer, meter, logger, zap logger and a closer into one value passed through the service.
- **Zap log bridge:** Sends zap records to the OTel logger provider while keeping JSON output on stdout.
- **Request context threading:** Checklist for passing the request context into GORM or database/sql calls so DB spans nest under HTTP spans.
- **Lean resource attributes:** Guidance to keep resource attributes to service and deployment identifiers and to honor OTEL_* variables.

## Good for

- Add OpenTelemetry tracing and metrics to an existing Go API service
- Restructure telemetry setup code in a Go project around a Providers struct
- Fix database spans that appear as detached root spans in Go traces
- Review a Go service's OpenTelemetry setup for resource attribute and PII issues
- Connect zap logging to OpenTelemetry log export in Go

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/ollygarden-otel-go-setup` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ollygarden/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/ollygarden-otel-go-setup &&
cp -R "$tmp/deprecated/ollygarden-otel-go-setup" ~/.claude/skills/ollygarden-otel-go-setup &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/ollygarden-otel-go-setup` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/ollygarden-otel-go-setup` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ollygarden/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/ollygarden-otel-go-setup &&
cp -R "$tmp/deprecated/ollygarden-otel-go-setup" ~/.agents/skills/ollygarden-otel-go-setup &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/ollygarden-otel-go-setup` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/ollygarden-otel-go-setup` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ollygarden/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/ollygarden-otel-go-setup &&
cp -R "$tmp/deprecated/ollygarden-otel-go-setup" ~/.cursor/skills/ollygarden-otel-go-setup &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/ollygarden-otel-go-setup` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ollygarden/skills.git --path deprecated/ollygarden-otel-go-setup
```

Or copy the folder to `~/.gemini/skills/ollygarden-otel-go-setup` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/ollygarden-otel-go-setup`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ollygarden/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/ollygarden-otel-go-setup &&
cp -R "$tmp/deprecated/ollygarden-otel-go-setup" ~/.copilot/skills/ollygarden-otel-go-setup &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/ollygarden-otel-go-setup` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ollygarden/skills.git
```

Then copy `skills/deprecated/ollygarden-otel-go-setup` into your agent's skills folder as `ollygarden-otel-go-setup`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need from my Go project?

It assumes a Go service that uses the otelconf package from go.opentelemetry.io/contrib and zap for logging, with a configs/otel.yaml file for declarative SDK settings.

### What happens if the OpenTelemetry config file is missing?

The setup logs a warning and returns no-op providers instead of failing, so the application runs without telemetry.

### Which runtime attributes does the setup add?

It adds service.version from the build and a generated per-process service.instance.id to the resource when the config does not already set them.

### Does the skill run any scripts or change files for me?

No. It ships no scripts and provides instructions and code patterns for the agent to apply.

### How do I install Ollygarden otel go setup in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/ollygarden-otel-go-setup to use it in all your projects, or to .claude/skills/ollygarden-otel-go-setup in one project.

### Does Ollygarden otel go setup run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Ollygarden otel go setup?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Ollygarden otel go setup?

The closest alternatives to Ollygarden otel go setup are Ollygarden otel js setup, Ollygarden otel SDK setup, Ollygarden otel java setup, Ollygarden otel declarative config and Go observability.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Ollygarden otel js setup](https://ai-powered.com/skills/ollygarden-otel-js-setup): Ollygarden otel js setup is an open-source agent skill for developer tools.
- [Ollygarden otel SDK setup](https://ai-powered.com/skills/ollygarden-otel-sdk-setup): Ollygarden otel SDK setup is an open-source agent skill for developer tools.
- [Ollygarden otel java setup](https://ai-powered.com/skills/ollygarden-otel-java-setup): Ollygarden otel java setup is an open-source agent skill for developer tools.
- [Ollygarden otel declarative config](https://ai-powered.com/skills/ollygarden-otel-declarative-config): Ollygarden otel declarative config is an open-source agent skill for developer tools.
- [Go observability](https://ai-powered.com/skills/go-observability): Go observability is an open-source agent skill for developer tools.
- [Ollygarden otel instrumentation planning](https://ai-powered.com/skills/ollygarden-otel-instrumentation-planning): Ollygarden otel instrumentation planning is an open-source agent skill for developer tools.
- [Ollygarden otel manual instrumentation](https://ai-powered.com/skills/ollygarden-otel-manual-instrumentation): Ollygarden otel manual instrumentation is an open-source agent skill for developer tools.
- [Ollygarden otel auto instrumentation](https://ai-powered.com/skills/ollygarden-otel-auto-instrumentation): Ollygarden otel auto instrumentation is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/ollygarden-otel-go-setup
