Skip to content

The tracer cannot handle multiple threads #129

@swebb

Description

@swebb

This is a limitation with the current implementation. Not a bug.

The tracer is explicitly designed to run within one thread. For example here. Ideally the tracer could be made threadsafe so that multiple threads could write to it, possibly similar to the Buildkite::TestCollector::Session.

This issue effects both RSpec and Minitest.

This limitation is most noticeable in System/Feature tests. Capybara spins up the web server (Puma/Unicorn/etc.) in a separate thread. As a result the tracer only collects SQL queries from the RSpec thread (i.e., test data getting created or verified). The SQL performed by the application is not captured.

Here's an example of the span data from a system test. The server is performing a User.where(email: email) but it is not captured.

image

As this data is not captured by the tracer it also won't be populated in the "slowest sql queries" section.

Note that since the tracer isn't available to the server thread it means HTTP requests will also not be captured.

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