Skip to content

Tracing extension doesn't work properly when used with async code #448

@ibralu

Description

@ibralu

Expected Behavior

Should build correct spans tree
image

Actual Behavior

Inconsistent span trees, some spans are missing parent.
Don't think span.with_subscriber(|(id, d)| d.enter(id)) works in multi threaded runtime

image

Steps to Reproduce the Problem

  1. Clone this repo https://github.com/ibralu/async-graphql-tracing. I've used starwars example with sleep on resolvers
  2. Start jaeger
docker run -d --name jaeger \
  -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
  -p 5775:5775/udp \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 5778:5778 \
  -p 16686:16686 \
  -p 14268:14268 \
  -p 14250:14250 \
  -p 9411:9411 \
  jaegertracing/all-in-one:1.22
  1. Test with query
{
  hero(episode: EMPIRE) {
    id
    name
    friends {
      id
      name
    }
    appearsIn
  }
}


Specifications

  • Version: 2.6
  • Platform: macOS
  • Subsystem: 11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions