Skip to content

suggestions on how to improve integration with rust tracing #30

@dshulyak

Description

@dshulyak

i started to use it and realized that it shows confusing/incorrect things sometimes.
i can submit changes, but just want to be sure that you are comfortable with them.

  1. do not report track slice begin when span is created (on_new_span)

it is valid to enter a span after creation, it can be even moved to a different thread before being entered. so if you enter in Sync flavor when it was created it will sometimes show wrong information.

my take is that code should only record debug attributes in on_new_span and record slice begin in on_enter call regardless of flavor.

  1. don't create a separate track for tokio tasks (or any async tasks)

they just get all mixed up and it is impossible to tell what is actually executed.
after i changed code to use thread track (note that i am using os thread instead of random thread unique id) the output looks like this:

Image

on the screenshot you can clearly see when tasks are actually on cpu and which tokio thread executes them.
and i plan to pass tokio task id as one of the arguments, so that it is easier to find out what is the wait time and total time

  1. no need to use sync/async flavors

reporting slice begin on on_enter and slice end on on_exit will always output expected information about which task is making progress and what thread it uses for that. i think it might be useful to report on_close as an instant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions