spin
spin copied to clipboard
Sleeping in a Spin app breaks traces
Traces are not properly emitted when a Spin app sleeps.
The commit that introduced this regression is most likely here.
e.g.
use spin_sdk::http::{IntoResponse, Response};
use spin_sdk::http_component;
use spin_sdk::observe;
/// A simple Spin HTTP component.
#[http_component]
async fn hello_world(_req: http::Request<()>) -> anyhow::Result<impl IntoResponse> {
std::thread::sleep(std::time::Duration::from_millis(500));
Ok(Response::new(200, "Hello, world!"))
}
(As discovered by @calebschoepp) Disabling metrics fixes this. Seems probable that this is an upstream tracing-opentelemetry or opentelemetry bug.
Potentially related to #2525