Otel Span Events To Logs Migration logo

Otel Span Events To Logs Migration

Organization
ollygarden
otel-span-events-to-logs-migration

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.

Overview

Publisherollygarden
Repositoryopentelemetry-agent-skills
Skill nameotel-span-events-to-logs-migration
Stars
119
Forks
13
Bundled files
5
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ollygarden on GitHub. Read the source before you install it.

Installation

Install the Otel Span Events To Logs Migration AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ollygarden/opentelemetry-agent-skills/tree/main/skills/otel-span-events-to-logs-migration
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ollygarden/opentelemetry-agent-skills.git /tmp/opentelemetry-agent-skills
mkdir -p .claude/skills
cp -r /tmp/opentelemetry-agent-skills/skills/otel-span-events-to-logs-migration .claude/skills/otel-span-events-to-logs-migration
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Otel Span Events To Logs Migration in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Otel Span Events To Logs Migration on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Otel Span Events To Logs Migration is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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-25 (specification v1.62.0): 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.

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Otel Span Events To Logs Migration AI skill do?

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.

Why use Otel Span Events To Logs Migration on TypingMind?

Because you install it once and use it with any model. Otel Span Events To Logs Migration is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ollygarden/opentelemetry-agent-skills/tree/main/skills/otel-span-events-to-logs-migration. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Otel Span Events To Logs Migration?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Otel Span Events To Logs Migration?

As many as you like. As long as a model supports skills, you can use Otel Span Events To Logs Migration with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Otel Span Events To Logs Migration AI skill free?

Yes. It is published on GitHub by ollygarden under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇