spin icon indicating copy to clipboard operation
spin copied to clipboard

Sleeping in a Spin app breaks traces

Open calebschoepp opened this issue 1 year ago • 2 comments

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!"))
}

calebschoepp avatar May 03 '24 19:05 calebschoepp

(As discovered by @calebschoepp) Disabling metrics fixes this. Seems probable that this is an upstream tracing-opentelemetry or opentelemetry bug.

lann avatar May 03 '24 20:05 lann

Potentially related to #2525

calebschoepp avatar Jun 14 '24 20:06 calebschoepp