Agent skill

Otel Span Events To Logs Migration

by ollygarden in ollygarden/opentelemetry-agent-skills

Migrate OpenTelemetry Span Events (AddEvent, RecordException, and language equivalents) to the Logs API following the accepted OTEP 4430 migration plan.

Apache-2.0Auto-check passedDevOps & Cloud

Install Otel Span Events To Logs Migration

skills CLI
$ npx skills add ollygarden/opentelemetry-agent-skills --skill otel-span-events-to-logs-migration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ollygarden/opentelemetry-agent-skills otel-span-events-to-logs-migration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ollygarden/opentelemetry-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/otel-span-events-to-logs-migration .claude/skills/otel-span-events-to-logs-migration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
otel-span-events-to-logs-migration
GitHub stars
106
Token cost
~1.8k tokens
SKILL.md length
863 words
Files
6 (incl. scripts, references)
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Migrate OpenTelemetry Span Events (AddEvent, RecordException, and language equivalents) to the Logs API following the accepted OTEP 4430 migration plan.

  • Works in 6 steps: scan and classify all span event call… → migrate each call site following the… → review the changed code against the… → …
  • Migrating instrumentation from span events to log-based events
  • SKILL.md covers Background, Workflow, Required Completion Loop and Migration Checklist, plus 1 more section
  • Runs Shell scripts from its folder

What it does

Otel Span Events To Logs Migration is an agent skill from ollygarden/opentelemetry-agent-skills. Migrate OpenTelemetry Span Events (AddEvent, RecordException, and language equivalents) to the Logs API following the accepted OTEP 4430 migration plan. Use when migrating instrumentation from span events to log-based events, reviewing code that still uses AddEvent or RecordException, or planning a codebase migration while preserving trace correlation.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `references/backward-compat.md`, `references/decision-tree.md` and `references/deprecation-plan.md`).

It sits in DevOps & Cloud, covering Observability. It works with OpenTelemetry. The repository describes itself as: Vendor-neutral OpenTelemetry skills for AI coding agents like Claude Code, Cursor, and Codex, grounded in upstream sources. The licence is Apache-2.0.

When your agent uses it

  • Migrating instrumentation from span events to log-based events
  • Reviewing code that still uses AddEvent
  • RecordException
  • Planning a codebase migration while preserving trace correlation

Example prompts

  • “/otel-span-events-to-logs-migration”

Requirements

  • A Bash shell

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. scan and classify all span event call sites
  2. migrate each call site following the decision tree and patterns
  3. review the changed code against the checklist below
  4. re-open the changed files and confirm each checklist item with codebase evidence
  5. if any item is unresolved, patch the code or mark it not applicable with a reason, then repeat the review
  6. do not finish until every checklist item is completed or explicitly marked not applicable

What it can do on your machine

Read from SKILL.md and the folder at commit 9900032. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Otel Span Events To Logs Migration loads about 1.8k tokens when it runs, and up to ~7.8k if it reads all its reference files. Until then it costs about 97 tokens; SKILL.md has 863 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~97
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ollygarden/opentelemetry-agent-skills at commit 9900032, republished under its Apache-2.0 licence (© ollygarden). 863 words, ~1,829 tokens.

Download SKILL.mdSave it as .claude/skills/otel-span-events-to-logs-migration/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
otel-span-events-to-logs-migration
description
Migrate OpenTelemetry Span Events (AddEvent, RecordException, and language equivalents) to the Logs API following the accepted OTEP 4430 migration plan. Use when migrating instrumentation from span events to log-based events, reviewing code that still uses AddEvent or RecordException, or planning a codebase migration while preserving trace correlation.

Span Events to Logs Migration

Use this skill to migrate instrumentation from the Span Event API (AddEvent, RecordException, and language equivalents) to the Logs API, following the accepted OTEP 4430 deprecation plan.

Background

The OpenTelemetry project accepted a plan to deprecate Span.AddEvent and Span.RecordException in favor of emitting events and exceptions through the Logs API. Span Events as a concept remain valid -- they can be emitted via logs that correlate to the active span, and optionally bridged back into the span proto.

Status as of 2026-10-03: OTEP 4430 is accepted, log-based event/exception emission is specified in the Logs API, and the SDK "event to span event bridge" is specified with Development status. The trace API methods AddEvent/RecordException are not yet formally marked Deprecated in the specification -- that step is still pending. Treat existing span-event calls as migration candidates, not automatically invalid code; some SDK-specific equivalents have already changed status (for example OpenTelemetry .NET's Activity.RecordException extension is [Obsolete] in favor of Activity.AddException, which is still a span-event API).

See references/deprecation-plan.md for the full context.

Workflow

  1. Prepare before migrating.
  • check the project's OpenTelemetry SDK version supports log-based events (check the otel-sdk-versions skill's version index if available)
  • identify whether the project has a LoggerProvider configured; if not, one must be set up
  • determine if downstream consumers (backends, dashboards, alerts) depend on span events appearing in the span proto envelope
  1. Scan the codebase for span event usage.
  • search for AddEvent, add_event, addEvent, RecordException, record_exception, recordException, RecordError, record_error, AddException, and language-specific variants
  • categorize each call site: general event, exception recording, or informational annotation
  • note the span context, attributes, and timestamp usage at each site
  1. Classify each call site using the decision tree.
  • see references/decision-tree.md for the full classification logic
  • the three outcomes are: migrate to log-based event, convert to span attributes, or remove
  1. Apply the migration for each call site.
  • see references/migration-patterns.md for language-specific before/after patterns
  • ensure the replacement log record carries the correct span context, event name, attributes, and timestamp; for exceptions use the applicable semantic-convention event name (normally an operation-specific .exception name), reserving exception for generic handlers
  • in Go (1.47.0+, Logs API/SDK stable), get loggers with otel.Logger from the root go.opentelemetry.io/otel package (otel/log/global is deprecated)
  • in Java, the contrib io.opentelemetry.contrib.eventbridge.EventToSpanEventBridge was removed in opentelemetry-java-contrib v1.60.0; use io.opentelemetry.sdk.extension.incubator.logs.EventToSpanEventBridge from opentelemetry-sdk-extension-incubator (see references/backward-compat.md)
  • in Go, log.Record.AddAttributes accepts attribute.KeyValue: use attribute.String(...), not log.String(...); set the event name with Record.SetEventName(...)
  • for exceptions, preserve the applicable semconv attributes: exception.type and exception.message (at least one is required), plus exception.stacktrace when the language/error type makes it meaningful (in Go, omit it unless an error library preserves the origin stack -- do not call runtime.Stack at the emit site)
  1. If backward compatibility is needed, configure the SDK bridge.
  • see references/backward-compat.md
  • this is an SDK-level log processor that converts log-based events back to span events
  • only needed when downstream systems require span events in the same proto envelope as the span
  1. Verify the migration.
Show full SKILL.md (376 more words)Show less

Required Completion Loop

Follow this loop every time:

  1. scan and classify all span event call sites
  2. migrate each call site following the decision tree and patterns
  3. review the changed code against the checklist below
  4. re-open the changed files and confirm each checklist item with codebase evidence
  5. if any item is unresolved, patch the code or mark it not applicable with a reason, then repeat the review
  6. do not finish until every checklist item is completed or explicitly marked not applicable

Do not mark a checklist item complete based on intent alone. Mark it complete only after confirming it in the current codebase.

Migration Checklist

For every item, report one of these statuses in the final answer:

  • [x] completed
  • [~] not applicable, with a reason
  • [ ] unresolved

Include file references as evidence for every completed item.

  • [ ] All general span-event call sites identified and classified, including AddEvent / add_event / addEvent and language equivalents such as .NET ActivityEvent.
  • [ ] All exception span-event call sites identified and classified, including RecordException / record_exception / recordException and language equivalents such as Go RecordError, Rust record_error, and .NET AddException.
  • [ ] A LoggerProvider is configured in the SDK setup (or already existed).
  • [ ] Each migrated event uses the Logs API with the correct event name and attributes.
  • [ ] Each migrated exception preserves the applicable semconv attributes: exception.type and exception.message (at least one is required), plus exception.stacktrace when the language/error type makes it meaningful.
  • [ ] Migrated log records carry the active span context for trace correlation.
  • [ ] Call sites classified as "convert to span attributes" now use span attributes instead.
  • [ ] Call sites classified as "remove" have been removed with justification.
  • [ ] Backward compatibility bridge is configured if downstream systems require span events in the span envelope.
  • [ ] No remaining span-event API call sites are left unintentionally; any retained AddEvent / RecordException / RecordError / AddException / ActivityEvent / equivalent call is justified for current-version compatibility.
  • [ ] The changed files were re-read after implementation to verify the final state.
  • [ ] The final answer includes this checklist, file evidence, and any remaining risks or gaps.

Final Review Format

In the final answer, include the checklist in this format:

  • [x] LoggerProvider configured. Evidence: src/telemetry/setup.go:42 -- added OTLP log exporter with batch processor.
  • [~] Backward compatibility bridge. Reason: no downstream systems depend on span events in the proto envelope.
  • [ ] Exception migration. Missing evidence; re-check required.

© ollygarden, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in skills/otel-span-events-to-logs-migration of ollygarden/opentelemetry-agent-skills.

  • SKILL.md
  • references/backward-compat.md
  • references/decision-tree.md
  • references/deprecation-plan.md
  • references/migration-patterns.md
  • scripts/scan-span-events.sh

Open the folder on GitHubat commit 9900032

Compare with similar skills

Otel Span Events To Logs Migration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Otel Span Events To Logs Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Otel Span Events To Logs Migration this skillollygarden/opentelemetry-agent-skills106—~1.8kAutomated safety check: PassApache-2.0
Motel Debugkitlangton/motel298—~2.2kAutomated safety check: PassMIT
Tempsgotempsh/temps833—~2kAutomated safety check: PassApache-2.0
Axiom Metrics Queryopenclaw/clawhub9.5k—~2.6kAutomated safety check: PassMIT
UModel Root Cause Analysisalibaba/UnifiedModel415—~1.9kAutomated safety check: PassCustom licence
Agent Kill Switchvivekchand/clawmetry426—~1.1kAutomated safety check: PassMIT

Similar skills

  • Motel Debug

    kitlangton/motel

    Debug applications with motel, a local OpenTelemetry ingest and query server.

    298 GitHub stars~2.2k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Temps

    gotempsh/temps

    Manage, deploy, operate, and instrument applications with Temps.

    833 GitHub stars~2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Axiom Metrics Query

    openclaw/clawhub

    Explores and queries OpenTelemetry metrics in Axiom MetricsDB, listing datasets, metrics and tags first and picking the right aggregation for each metric's type.

    9.5k GitHub stars~2.6k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • UModel Root Cause Analysis

    alibaba/UnifiedModel

    Investigates a service incident to its root cause by querying a UModel object graph alongside metrics, logs, topology and recent deployments.

    415 GitHub stars~1.9k tokensUpdated 17 days ago
    DevOps & CloudAuto-check passed
  • Agent Kill Switch

    vivekchand/clawmetry

    Give the human an off switch and a cost meter for the coding agents on this machine, using ClawMetry.

    426 GitHub stars~1.1k tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Agentmeasure

    roy-tong/AgentMeasure

    Check whether agent telemetry preserves measurement semantics.

    219 GitHub stars~753 tokensUpdated today
    DevOps & CloudAuto-check passed

More from ollygarden/opentelemetry-agent-skills

All 20 skills in this repo
  • Otel Collector Builder

    ollygarden/opentelemetry-agent-skills

    Build custom OpenTelemetry Collector distributions with OCB (OpenTelemetry Collector Builder).

    106 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Otel Go

    ollygarden/opentelemetry-agent-skills

    OpenTelemetry in Go — SDK setup, API surface, breaking changes, contrib instrumentation libraries (otelhttp, otelgrpc, otelmongo), compile-time zero-code instrumentation (otelc), and performance…

    106 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Otel Ottl

    ollygarden/opentelemetry-agent-skills

    OpenTelemetry Transformation Language (OTTL) expert for writing and debugging telemetry transformations in the OpenTelemetry Collector.

    106 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Otel Profiles

    ollygarden/opentelemetry-agent-skills

    OpenTelemetry profiles signal and the eBPF profiler (otelcol-ebpf-profiler, profiling receiver).

    106 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Otel Telemetrygen

    ollygarden/opentelemetry-agent-skills

    Build safe, version-pinned telemetrygen commands for synthetic OTLP traces, metrics, and logs.

    106 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Otel Upgrade

    ollygarden/opentelemetry-agent-skills

    Assess OpenTelemetry package and Collector upgrades across ecosystems.

    106 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Otel Span Events To Logs Migration

What does Otel Span Events To Logs Migration do?

Migrate OpenTelemetry Span Events (AddEvent, RecordException, and language equivalents) to the Logs API following the accepted OTEP 4430 migration plan. Otel Span Events To Logs Migration is an agent skill from ollygarden/opentelemetry-agent-skills. Migrate OpenTelemetry Span Events (AddEvent, RecordException, and language equivalents) to the Logs API following the accepted OTEP 4430 migration plan.

When should I use Otel Span Events To Logs Migration?

Otel Span Events To Logs Migration fits situations like: migrating instrumentation from span events to log-based events; reviewing code that still uses AddEvent; recordException; planning a codebase migration while preserving trace correlation.

How do I install Otel Span Events To Logs Migration in Claude Code?

Run `npx skills add ollygarden/opentelemetry-agent-skills --skill otel-span-events-to-logs-migration -a claude-code`. Or copy the skill folder (skills/otel-span-events-to-logs-migration in ollygarden/opentelemetry-agent-skills) into .claude/skills/otel-span-events-to-logs-migration in your project. Claude Code loads it when a task matches its description.

How do I install Otel Span Events To Logs Migration in Codex?

Run `npx skills add ollygarden/opentelemetry-agent-skills --skill otel-span-events-to-logs-migration -a codex`. Or copy the skill folder (skills/otel-span-events-to-logs-migration in ollygarden/opentelemetry-agent-skills) into .agents/skills/otel-span-events-to-logs-migration in your project. Codex loads it when a task matches its description.

Can I use Otel Span Events To Logs Migration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ollygarden/opentelemetry-agent-skills --skill otel-span-events-to-logs-migration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/otel-span-events-to-logs-migration, .gemini/skills/otel-span-events-to-logs-migration, .github/skills/otel-span-events-to-logs-migration and .opencode/skills/otel-span-events-to-logs-migration in your project.

What does Otel Span Events To Logs Migration need to run?

Going by SKILL.md and its folder, Otel Span Events To Logs Migration needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does Otel Span Events To Logs Migration access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Otel Span Events To Logs Migration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Otel Span Events To Logs Migration use?

Otel Span Events To Logs Migration is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Otel Span Events To Logs Migration use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.9k tokens, read only when the agent opens those files.

What are the alternatives to Otel Span Events To Logs Migration?

Skills that share tags, products or a category with Otel Span Events To Logs Migration: Motel Debug (kitlangton/motel, 298 stars), Temps (gotempsh/temps, 833 stars), Axiom Metrics Query (openclaw/clawhub, 9.5k stars) and UModel Root Cause Analysis (alibaba/UnifiedModel, 415 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Otel Span Events To Logs Migration?

ollygarden (a GitHub organization) maintains it in ollygarden/opentelemetry-agent-skills, which has 106 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 11, 2026.

Source: ollygarden/opentelemetry-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.