Skip to content

feat(opentelemetry): start_as_current_span honors the attributes= kwarg#145

Merged
ivarvong merged 2 commits into
mainfrom
feat/otel-attrs-and-differential-harness
Jul 7, 2026
Merged

feat(opentelemetry): start_as_current_span honors the attributes= kwarg#145
ivarvong merged 2 commits into
mainfrom
feat/otel-attrs-and-differential-harness

Conversation

@ivarvong

@ivarvong ivarvong commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

start_as_current_span(name, attributes={...}) now honors the attributes= kwarg — the mapping seeds the span at open and merges with later set_attribute calls. Includes a dead-default-arg cleanup in span_cm that --warnings-as-errors would flag.

Two new tests in opentelemetry_test.exs (kwarg alone; kwarg merging with set_attribute).

Scope note: this PR originally also carried the WasmGC entry point + differential harness from the wasm working session. Those need a beam2wasm dev dep, and a path-based sibling checkout is too fragile to ship — they're moving to a composition repo (pyex.dev) that depends on pyex + beam2wasm via git deps. This PR is now the pure-interpreter remainder.

Test plan

  • mix format --check-formatted
  • mix compile --warnings-as-errors (modulo the three pre-existing 1.20.2-local warnings on main)
  • mix test + mix dialyzer — clean
  • CI green (watching)

🤖 Generated with Claude Code

https://claude.ai/code/session_01KuxYKoh8pXEna5ohZUgJsn

ivarvong and others added 2 commits July 2, 2026 17:47
…ness

Three pieces from the wasm working session, extracted onto main (the
container-identity fix landed separately as #143):

- opentelemetry: start_as_current_span honors the attributes= kwarg,
  seeding the span at open; merges with set_attribute calls. Two tests.
- Pyex.Wasm: the `mix wasm.build` entry point — pyrun/3 runs a program
  in a fresh Ctx against an in-memory VFS and returns stdout, footprint,
  final files, and BOTH runtime and app spans as JSON. The beam2wasm
  compiler is a sibling-checkout dev dep, loaded only when the checkout
  exists, so CI and consumers resolve deps without it (the wasm: project
  config is inert without the dep).
- test/differential: a three-executor harness (CPython · pyex-VM ·
  pyex-Wasm) that auto-localizes divergences — CPython≠VM is an
  interpreter bug, VM≠Wasm is a compiler bug — gated by a checked-in
  LEDGER of known divergences. Aliasing lens (constructor × storage ×
  mutation product) plus a 25-program realistic corpus; 79/79 green at
  time of extraction. Runs via `mix run test/differential/run.exs`
  (needs wasm/pyex.wasm and python3), not in `mix test`.

Also: span_cm loses a dead default arg (warning), and Wasm.pyrun's
rescue clause interpolates type-safely without Exception.message/1
(protocol dispatch the wasm target can't lower).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KuxYKoh8pXEna5ohZUgJsn
The ../elixir_wasm path-based dev dep was too fragile to ship, even
guarded. The wasm entry point, build config, and differential harness
move to a third project that composes pyex + beam2wasm via git deps
and owns the pyex.dev site and edge API.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KuxYKoh8pXEna5ohZUgJsn
@ivarvong ivarvong changed the title feat: OTel attributes= kwarg, WasmGC target, and the differential harness feat(opentelemetry): start_as_current_span honors the attributes= kwarg Jul 2, 2026
@ivarvong
ivarvong merged commit a08b0bc into main Jul 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant