Skip to content

WASI OTel#3346

Merged
calebschoepp merged 1 commit intospinframework:mainfrom
asteurer:wasi-otel
Feb 6, 2026
Merged

WASI OTel#3346
calebschoepp merged 1 commit intospinframework:mainfrom
asteurer:wasi-otel

Conversation

@asteurer
Copy link
Contributor

@asteurer asteurer commented Nov 4, 2025

Overview

This is an implementation of WASI OTel which gives guest applications the ability to export traces, metrics and logs with OpenTelemetry SDKs.

We see two options for adding this to Spin:

  • Require the user to compile Spin with configuration flags that will enable this feature.
  • Have this feature available out-of-the-box and add an experimental-features flag that the user will pass to spin up.

To help ease adoption, we would prefer to pass a flag to spin up, but we know there was some previous work around this with wasip3 so we're happy to defer to that process.

Some additional notes:

  • In the root Cargo.toml, you will notice that certain experimental features are being enabled for the opentelemetry-sdk dependency, and that we are using reqwest-client instead of reqwest-blocking-client in the opentelemetry dependency. These are all to prevent runtime errors that come from the default OpenTelemetry dependency configurations conflicting with Spin's async runtime.
  • wasi-otel has been moved to Phase 1.

Usage

To try the features added in this PR, do the following:

  1. Build Spin from this branch:
git clone --branch wasi-otel --depth 1 https://github.com/asteurer/spin
cd spin
cargo install --path .
spin plugin update
spin plugin install otel
  1. Clone OpenTelemetry WASI and try the Rust example applications:
git clone https://github.com/calebschoepp/opentelemetry-wasi
spin otel setup

cd opentelemetry-wasi/rust/examples/spin-basic
spin otel up -- --build --experimental-wasi-otel

# In a different terminal window
spin otel open jaeger
spin otel open grafana
curl localhost:3000

@calebschoepp
Copy link
Collaborator

@lann I think you would likely be the most relevant reviewer for this

@calebschoepp calebschoepp requested review from lann and rylev November 18, 2025 18:24
Copy link
Collaborator

@lann lann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was mostly just a shallow pass here with a few surface-level comments.

Looking at how this code is working, I think there may be a viable approach that wouldn't require changes to the outbound factors. I only have a minute right now but briefly:

  • Use a task-local to manage state through the host-guest-host burger
  • Use an otel span processor that uses that task-local to conditionally reparent spans

@asteurer asteurer requested a review from rylev November 25, 2025 22:48
@fibonacci1729 fibonacci1729 moved this to Triage Needed in Spin Triage Dec 15, 2025
@fibonacci1729 fibonacci1729 moved this from Triage Needed to In Progress in Spin Triage Dec 15, 2025
@calebschoepp
Copy link
Collaborator

@lann do you mind taking another pass at this?

Copy link
Collaborator

@lann lann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review might take a while - leaving an initial batch of comments now but I'll have to come back to it.

@calebschoepp calebschoepp removed the request for review from rylev February 5, 2026 18:14
@calebschoepp calebschoepp force-pushed the wasi-otel branch 2 times, most recently from 0530a44 to 8409053 Compare February 6, 2026 03:45
Adds experimental support for WASI OTel

Signed-off-by: Caleb Schoepp <caleb.schoepp@fermyon.com>
Co-authored-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
@calebschoepp calebschoepp merged commit 10d4e24 into spinframework:main Feb 6, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

7 participants