Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better interop with #[instrument] #1

Open
rcoh opened this issue Jan 17, 2022 · 2 comments
Open

better interop with #[instrument] #1

rcoh opened this issue Jan 17, 2022 · 2 comments

Comments

@rcoh
Copy link
Owner

rcoh commented Jan 17, 2022

currently, there isn't an easy way to examine a span if you don't have access to the span itself

@hawkw
Copy link

hawkw commented Jan 18, 2022

Does this work?

#[instrument]
fn whatever(something: usize) {
    tracing_texray::examine(Span::current().in_scope(|| {
       // do stuff
    });
}

I wonder if the in_scope() call is even necessary here since the span is already entered by the instrument call...

@rcoh
Copy link
Owner Author

rcoh commented Jan 18, 2022

probably but since it doesn't start tracking the span until the call to examine, we might miss the span being entered the first time, would need to try it out and see

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

No branches or pull requests

2 participants