feat(opentelemetry): start_as_current_span honors the attributes= kwarg#145
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
start_as_current_span(name, attributes={...})now honors theattributes=kwarg — the mapping seeds the span at open and merges with laterset_attributecalls. Includes a dead-default-arg cleanup inspan_cmthat--warnings-as-errorswould flag.Two new tests in
opentelemetry_test.exs(kwarg alone; kwarg merging withset_attribute).Scope note: this PR originally also carried the WasmGC entry point + differential harness from the wasm working session. Those need a
beam2wasmdev 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-formattedmix compile --warnings-as-errors(modulo the three pre-existing 1.20.2-local warnings on main)mix test+mix dialyzer— clean🤖 Generated with Claude Code
https://claude.ai/code/session_01KuxYKoh8pXEna5ohZUgJsn