span-events-to-logs-migration
Installation
SKILL.md
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
- Prepare before migrating.
- check the project's OpenTelemetry SDK version supports log-based events (check the
manual-instrumentationskill'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