spinframework / spinframework/spin

Implement auto tracing for statically composed components

Open
#3,484 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

Spin already does some automatic tracing which provides a good out of the box tracing experience for users. It automatically traces service chaining, self requests, outbound requests and even host calls.

However static composition is opaque to the auto tracing in Spin. This means things like like middleware or component dependencies are not nicely auto traced for the user. We should fix that for a better user experience.

Doing this would presumably require some modifications of Wasmtime so that we can hook into the component graph and emit spans at the right locations.

Auto tracing all static composition introduces additional overhead so it should probably be an opt in feature (perhaps granular to the level of opting in per component). To aid in adoption though we could start with templates having it turned on so it is a bit of a opt-out-of-opt-in situation.

Long term we could get fancy and dynamically turn off tracing for calls into components where the overhead of the tracing is too large of a fraction of the total execution time of that component.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Spin's automatic tracing documentation and investigate how Wasmtime exposes the component graph for static composition. Define where spans should be emitted, how opt-in configuration should work, and how templates would enable it; done requires static component calls to appear in traces without imposing tracing when disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
backend, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.