From opentelemetry-agent-skills
Migrates OpenTelemetry Span Events (AddEvent, RecordException) to the Logs API per OTEP 4430. Scan codebase, classify call sites, apply migration patterns, and verify.
How this skill is triggered — by the user, by Claude, or both
Slash command
/opentelemetry-agent-skills:otel-span-events-to-logs-migrationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill to migrate instrumentation from the deprecated Span Event API (`AddEvent`, `RecordException`) to the Logs API, following the [OTEP 4430 deprecation plan](https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/4430-span-event-api-deprecation-plan.md).
Use this skill to migrate instrumentation from the deprecated Span Event API (AddEvent, RecordException) to the Logs API, following the OTEP 4430 deprecation plan.
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.
manual-instrumentation skill's version index if available)AddEvent, add_event, addEvent, RecordException, record_exception, recordException, and language-specific variantsreferences/decision-tree.md for the full classification logicreferences/migration-patterns.md for language-specific before/after patternsexception.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)references/backward-compat.mdFollow this loop every time:
Do not mark a checklist item complete based on intent alone. Mark it complete only after confirming it in the current codebase.
For every item, report one of these statuses in the final answer:
[x] completed[~] not applicable, with a reason[ ] unresolvedInclude 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.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.npx claudepluginhub ollygarden/opentelemetry-agent-skills --plugin otel-javaGuides phased OpenTelemetry migration for existing uninstrumented apps: SDK setup, context propagation refactoring, logging/metrics bridges, verification. For retrofitting without breaking monitoring.
Migrates Python SDK from transaction-based to span-first trace lifecycle for Sentry span streaming. Use when asked to enable span streaming or switch to streamed span delivery.
Correlates structured logs with distributed traces using OpenTelemetry context for unified observability. Useful for connecting log entries to trace IDs and migrating to structured logging.