# WasmLens: Automatic Glass-Box Instrumentation for Composed WebAssembly Applications

DevFeed: [WasmLens: Automatic Glass-Box Instrumentation for Composed WebAssembly Applications](<https://devfeed.tech/articles/wasmlens-automatic-glass-box-instrumentation-for-composed-webassembly-applications-127272.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.12710>)

Author: Michiel Van Kenhove, Ewout Verlinde, Jos\\'e Santos, Filip De Turck, Bruno Volckaert, Merlijn Sebrechts

Published: 2026-11-10T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [Wasm components](<https://devfeed.tech/topics/wasm-components.md>), [tracing](<https://devfeed.tech/topics/tracing.md>), [WebAssembly](<https://devfeed.tech/topics/web-assembly.md>), [middleware](<https://devfeed.tech/topics/middleware.md>)

Tags: [binaries](<https://devfeed.tech/tags/binaries.md>), [boundary](<https://devfeed.tech/tags/boundary.md>), [composition](<https://devfeed.tech/tags/composition.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [graph](<https://devfeed.tech/tags/graph.md>), [instrumentation](<https://devfeed.tech/tags/instrumentation.md>), [latency](<https://devfeed.tech/tags/latency.md>), [middleware](<https://devfeed.tech/tags/middleware.md>), [observability](<https://devfeed.tech/tags/observability.md>), [overhead](<https://devfeed.tech/tags/overhead.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [traces](<https://devfeed.tech/tags/traces.md>), [tracing](<https://devfeed.tech/tags/tracing.md>), [webassembly](<https://devfeed.tech/tags/webassembly.md>)

## AI overview

WasmLens reconstructs end-to-end traces across black-box WebAssembly components by injecting middleware into composed binaries, using instrumentation points derived from the composition graph. Its per-component span-stack tracing design restores parent-child relationships across component boundaries without changing component interfaces or source code; the abstract says this design was adopted upstream. In the reported measurements, mean request latency rose from 238 μs to 454 μs across six boundaries. Increasing the expected crossings from six to eleven raised latency to 514 μs, adding 12 μs per crossing, of which 10.4 μs was attributed to instrumentation. The authors characterize this overhead as additive with composition depth.

## Source excerpt

arXiv:2611.12710v1 Announce Type: new Abstract: The WebAssembly Component Model enables language-independent composition of independently developed components, but complicates observability. Existing tracing support flattens execution hierarchy by attributing every span created inside a composition to a single host-level parent context, so execution across component boundaries cannot be reconstructed. The problem is amplified because components are typically deployed as black boxes whose internals cannot be modified or inspected by the system integrator. To address these limitations, we propose a revised wasi:otel/tracing design in which the runtime maintains a per-component span stack, restoring parent-child relationships across component boundaries without changing component interfaces or source code. This change has since been adopted upstream. Building on this design, we present WasmLens, an automatic instrumentation tool that derives instrumentation points from a composition graph and injects tracing middleware into already composed binaries, yielding end-to-end traces for black-box compositions with no developer configuration. This automatic instrumentation raises mean request latency from $238$ $\mu$s to $454$ $\mu$s across six component boundaries. Raising the expected number of boundary crossings from 6 to 11 further increases latency to $514$ $\mu$s, an incremental cost of $12$ $\mu$s per crossing, of which $10.4$ $\mu$s is attributable to instrumentation. These results show that instrumentation overhead is additive in composition depth rather than proportional to baseline execution time.