Skip to content

Add trace components - #21

Merged
scothis merged 1 commit into
componentized:mainfrom
scothis:trace
Oct 3, 2026
Merged

scothis merged 1 commit into
componentized:mainfrom
scothis:trace

Conversation

@scothis

@scothis scothis commented Oct 3, 2026

Copy link
Copy Markdown
Member

Components that log each wasi:http call at the TRACE level, with the 'componentized-trace' context:

  • trace-types: wasi:http/types
  • trace-client: wasi:http/types and wasi:http/client
  • trace-handler: wasi:http/types and wasi:http/handler
  • trace: wasi:http/types, wasi:http/client and wasi:http/handler
  • trace-componentized-client: componentized:http/client

Each component exports only the interfaces it traces, so it imports nothing more from the host than it needs. Traced client and handler calls take the traced request and response resources, so they can't be composed from trace-types with wac. Instead, the four wasi:http components compile the shared sources in crates/trace with cargo features that select the world.

Resources are logged by the last four hex digits of their upstream handle, prefixed with &, e.g. SELF=&002a.

Tests run each component in wasmtime with wasi:http from wasmtime-wasi-http. Requests sent upstream are recorded and answered with a canned response, without the network. Body streams passed through from the host can't be read by the harness, so the tests check status and headers.

Components that log each wasi:http call at the TRACE level, with the
'componentized-trace' context:

* trace-types: wasi:http/types
* trace-client: wasi:http/types and wasi:http/client
* trace-handler: wasi:http/types and wasi:http/handler
* trace: wasi:http/types, wasi:http/client and wasi:http/handler
* trace-componentized-client: componentized:http/client

Each component exports only the interfaces it traces, so it imports
nothing more from the host than it needs. Traced client and handler
calls take the traced request and response resources, so they can't be
composed from trace-types with wac. Instead, the four wasi:http
components compile the shared sources in crates/trace with cargo
features that select the world.

Resources are logged by the last four hex digits of their upstream
handle, prefixed with `&`, e.g. `SELF=&002a`.

Tests run each component in wasmtime with wasi:http from
wasmtime-wasi-http. Requests sent upstream are recorded and answered
with a canned response, without the network. Body streams passed
through from the host can't be read by the harness, so the tests check
status and headers.

Signed-off-by: Scott Andrews <scott@andrews.me>
Co-Authored-By: Claude <noreply@anthropic.com>
@scothis
scothis merged commit ac27b51 into componentized:main Oct 3, 2026
3 checks passed
@scothis
scothis deleted the trace branch October 3, 2026 14:44
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