AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Otel Span Events To Logs Migration

skill-ollygarden-opentelemetry-agent-skills-otel-span-events-to-logs-migration · by ollygarden

Migrate OpenTelemetry Span Events (AddEvent, RecordException) to the Logs API following the OTEP 4430 deprecation plan. Use when migrating instrumentation from span events to log-based events, reviewing code that still uses AddEvent or RecordException, or planning a migration across a codebase.

No reviews yet
0 installs
32 views
0.0% view→install

Install

$ agentstack add skill-ollygarden-opentelemetry-agent-skills-otel-span-events-to-logs-migration

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-ollygarden-opentelemetry-agent-skills-otel-span-events-to-logs-migration)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Otel Span Events To Logs Migration? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Span Events to Logs Migration

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

Background

The OpenTelemetry project is deprecating Span.AddEvent and Span.RecordException in favor of emitting events and exceptions through the Logs API. The Span Event API is deprecated, but Span Events as a concept remain valid -- they are now emitted via logs that correlate to the active span.

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 manual-instrumentation 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, 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, 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 AddEvent / add_event / addEvent call sites identified and classified.
  • [ ] All RecordException / record_exception / recordException call sites identified and classified.
  • [ ] 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 references to the deprecated AddEvent or RecordException APIs unless intentionally kept for the current major version.
  • [ ] 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.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.