Skip to content

Bug in Tracing instrumentation? #386

Open
@QnnOkabayashi

Description

I'm currently authoring a tracing-forest, a Subscriber that performs diagnostics on trace data. We ran into an issue where isahc generates trace data where the entered duration of a parent span is shorter than the entered duration of its children. I've outlined the problem further in this issue. I think I've narrowed down the culprit to these lines:

isahc/src/handler.rs

Lines 403 to 404 in 79338ab

let span = tracing::trace_span!(parent: &self.span, "header");
let _enter = span.enter();

Here, the parent is passed in to the child and the child is entered, but the parent is not, causing the children to accumulate time while the parent idles. Is there a reason for not entering the parent span, or is this a bug? If it is intended, what is the motivation for it?

I would guess that the fix would look something like this, where the parent span is entered before the child:

let span = tracing::trace_span!(parent: &self.span, "header");
let _enter = self.span.enter(); // parent enters before the child
let _enter = span.enter();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething is borken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions