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

The tracer cannot handle multiple threads #129

Open
swebb opened this issue Jun 22, 2022 · 0 comments
Open

The tracer cannot handle multiple threads #129

swebb opened this issue Jun 22, 2022 · 0 comments

Comments

@swebb
Copy link
Contributor

swebb commented Jun 22, 2022

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.

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

1 participant