Skip to content

Conversation

@kate-goldenring
Copy link
Contributor

TODO: Determine why span is only appearing periodically. Seems to do with how we are passing the context of the spans on spawn.

@calebschoepp calebschoepp requested a review from lann May 9, 2024 21:00
Signed-off-by: Kate Goldenring <[email protected]>
@calebschoepp
Copy link
Contributor

@lann for some reason we're getting weird async Span issues and using in_current_span wasn't fixing them. From what I can tell we would only need in_current_span in aws.go, but even putting it everywhere didn't solve the issue.

fn start_receive_loop(engine: Arc<TriggerAppEngine<Self>>, client: &aws::Client, component: &Component) -> tokio::task::JoinHandle<TerminationReason> {
let future = Self::receive(engine, client.clone(), component.clone());
tokio::task::spawn(future)
tokio::task::spawn(future.in_current_span())
Copy link

Choose a reason for hiding this comment

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

There is no current span at this point is there? From the docs that appears to make it equivalent to .instrument(Span::new_disabled(...)).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it sounds like we may need to add a span to this function (#[instrument(name = "spin_trigger_sqs.start_receive_loop")? From our Spin triggers (HTTP and Redis), it seemed like an initial parent span was implied, so I am a little confused here

Copy link

Choose a reason for hiding this comment

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

}
}

#[instrument(name = "spin_trigger_sqs.process_message", skip_all, fields(otel.name = format!("{} receive", queue_name_from_url(&self.component.queue_url)), messaging.message.id = msg.display_id()))]
Copy link

Choose a reason for hiding this comment

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

I guess I would still expect this span to show up correctly, but I don't really know how a disabled parent span would play into that...

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.

3 participants