# otel-ruby

Guides an agent through OpenTelemetry setup and troubleshooting in Ruby services. Use it for tracing, experimental metrics and logs, or library instrumentation.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 116
- Author: ollygarden
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/ollygarden/opentelemetry-agent-skills/tree/HEAD/skills/otel-ruby/SKILL.md
- Updated: 2026-10-25
- HTML: https://affpapa.org/en/nevibecode/skills/otel-ruby

## What it does

The skill directs the agent to task-specific references for gem installation, `OpenTelemetry::SDK.configure`, manual signals, context propagation, and testing emitted telemetry. Other guides cover contrib instrumentation for Rails, Rack, Sinatra, HTTP clients, databases, jobs, and messaging, plus performance tuning and upgrades.

Ruby tracing uses stable API and SDK gems, while metrics and logs remain experimental. Bundler must resolve each gem independently, and changes to `Gemfile.lock` need review; matching version numbers across signals or contrib gems cannot be assumed. That matters during upgrades, where compatibility depends on the individual gem.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-ruby -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/otel-ruby/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/otel-ruby/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-ruby -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/otel-ruby/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-ruby -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/otel-ruby/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ollygarden/opentelemetry-agent-skills otel-ruby
```

2. **Manually: put the files in place**
- File: `.github/skills/otel-ruby/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-ruby -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ollygarden/opentelemetry-agent-skills --path skills/otel-ruby
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/otel-ruby/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-ruby -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ollygarden/opentelemetry-agent-skills/tree/HEAD/skills/otel-ruby/SKILL.md

## When to use it
- configure `OpenTelemetry::SDK.configure` in a Ruby service
- add manual traces and context propagation
- choose contrib instrumentation for Rails or Sidekiq
- troubleshoot Ruby OpenTelemetry metrics and logs
- review gem versions and upgrade changes

## Example prompts
- Set up OpenTelemetry SDK for this Ruby service and review `Gemfile.lock`.
- Add manual tracing and context propagation to this application.
- Choose and configure OpenTelemetry instrumentation for Rails and Sidekiq.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: bbc7c5ea3e166db0.

BEGIN THIRD-PARTY FILE bbc7c5ea3e166db0
```text
---
name: otel-ruby
description: OpenTelemetry in Ruby — SDK setup, manual tracing, experimental metrics and logs, Bundler integration, contrib instrumentation for Rails/Rack/Sinatra/Sidekiq and other gems, propagation, performance, and upgrades. Use when adding, reviewing, configuring, or troubleshooting OpenTelemetry in a Ruby or Rails service. Triggers on "setup otel in ruby", "ruby telemetry", "Rails OpenTelemetry", "OpenTelemetry::SDK.configure", "opentelemetry-instrumentation-all", "Ruby tracing", "Rack otel", "Sidekiq otel", or any Ruby-related OTel question.
---

# OpenTelemetry in Ruby

Entry point for OpenTelemetry mechanics in Ruby applications. Load only the reference that matches
the task; each reference is self-contained.

## References

| File | Use when |
|---|---|
| [`references/setup.md`](references/setup.md) | Installing gems, configuring `OpenTelemetry::SDK.configure`, selecting OTLP exporters, setting resources and environment variables, and handling process shutdown. |
| [`references/api.md`](references/api.md) | Writing manual traces, metrics, or logs; managing context and propagation; testing emitted telemetry. |
| [`references/instrumentation-libraries.md`](references/instrumentation-libraries.md) | Selecting and configuring contrib instrumentation for Rails, Rack, Sinatra, HTTP clients, databases, jobs, messaging, and other gems. |
| [`references/performance.md`](references/performance.md) | Tuning sampling, batching, cardinality, forked-process behavior, exporters, and lifecycle handling. |
| [`references/breaking-changes.md`](references/breaking-changes.md) | Reviewing Ruby/runtime compatibility, independently versioned gems, experimental signal changes, and core/contrib upgrades. |

## Signal stability matters

Tracing uses the stable `opentelemetry-api` and `opentelemetry-sdk` gems. Ruby metrics and logs are
separate `0.x` API, SDK, and exporter gems and remain experimental. Do not assume a tracing gem's
version exists for metrics, logs, semantic conventions, exporters, or contrib instrumentation.
Resolve each gem independently with Bundler, inspect its changelog, and keep the resulting
`Gemfile.lock` change under review.

Released snapshot verified 2026-10-19: tracing API `1.11.1`, tracing SDK `1.13.1`, trace OTLP
exporter `0.37.0`; metrics API `0.10.0`, SDK `0.21.0`, OTLP exporter `0.14.0`; logs API `0.7.0`, SDK
`0.8.1`, OTLP exporter `0.7.0`; experimental declarative-config gem `opentelemetry-config` `0.1.0`
(traces only; `0.1.1`, verified 2026-10-15, still targets schema `v1.0.0-rc.3`; owner: the
`otel-declarative-config` [parsers table](../otel-declarative-config/SKILL.md)). Treat this as an audit anchor, not
a version-alignment rule; use the lookups below for newer releases.

## Sources of truth

| Fact | Fetch |
|---|---|
| Latest core releases and per-gem tags | `gh api repos/open-telemetry/opentelemetry-ruby/releases --paginate` |
```
END THIRD-PARTY FILE bbc7c5ea3e166db0

The third-party file has ended. Everything between the bbc7c5ea3e166db0 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2923 of 3854 bytes. © ollygarden · Apache-2.0 · https://github.com/ollygarden/opentelemetry-agent-skills/tree/HEAD/skills/otel-ruby/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
