/opentelemetry-agent-skills:otel-span-events-to-logs-migrationfrom opentelemetry-agent-skills
Migrates OpenTelemetry Span Events (AddEvent, RecordException) to the Logs API following OTEP 4430. Scans codebases, classifies call sites, and applies language-specific migration patterns while preserving trace correlation.
Ships in opentelemetry-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
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.
In specification v1.62.0, OTEP 4430 is accepted and AddEvent/RecordException are not marked Deprecated (current status). Treat existing span-event calls as migration candidates, not invalid code, and check each SDK's own status.
See references/deprecation-plan.md for the full context.
otel-sdk-versions skill's version index if available)AddEvent, add_event, addEvent, RecordException, record_exception, recordException, RecordError, record_error, AddException, and language-specific variantsreferences/decision-tree.md for the full classification logicreferences/migration-patterns.md for language-specific before/after patterns.exception name), reserving exception for generic handlersotel.Logger from the root go.opentelemetry.io/otel package (otel/log/global is deprecated)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)log.Record.AddAttributes accepts attribute.KeyValue: use attribute.String(...), not log.String(...); set the event name with Record.SetEventName(...)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)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 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.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.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
20 skills in this plugin
/otel-browserOpenTelemetry browser/RUM mechanics for SPAs and MPAs. Use for “browser OTel,” “frontend observability,” “Web Vitals,” `sdk-trace-web`, `WebTracerProvider`, `browser-sdk`, browser instrumentations, page-load or route tracing, sessions, clicks, console capture, JavaScript errors, or frontend-to-backend trace correlation. Browser telemetry is privacy- and volume-sensitive, and experimental packages move quickly. Not for Node.js service instrumentation or Collector-only configuration./otel-cicdObserve CI/CD pipelines with OpenTelemetry. Use when turning GitHub Actions or GitLab CI/CD runs, jobs and steps into traces with the Collector `github` or `gitlab` receiver (workflow_run and pipeline webhooks, the GitHub scraper), or keeping raw webhook payloads as logs with `webhook_event`; collecting pull-request, branch and repository (VCS) or DORA metrics such as lead time for changes; joining build or test processes to the pipeline trace through `TRACEPARENT` or otel-cli; exporting OTLP from Jenkins, Argo Workflows, Tekton, Buildkite, Concourse or Dagger; or applying the `cicd.*` and `vcs.*` semantic conventions. Triggers on "trace our GitHub Actions workflows", "GitLab pipeline traces in the Collector", "make test spans join the CI trace", and "instrument our pipeline runner". Not for testing OpenTelemetry changes in CI, dependency-update automation, or deployment verification.Generated from the plugin's indexed repository (ollygarden/opentelemetry-agent-skills) — no native marketplace selected
npx claudepluginhub p/ollygarden-opentelemetry-agent-skillsOther plugins' skills for the same job