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

Fix:Double initialization when auto instrumenting non-Rails applications #1497

Merged
merged 1 commit into from
May 11, 2021

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented May 10, 2021

We were invoking AutoInstrument.patch_all twice for users of 'ddtrace/auto_instrument' that are not running a Rails application.

This PR removes the unnecessary double call. Invoking AutoInstrument.patch_all multiple times has no ill effect, but creates unnecessary overhead.

Also, a few of the tests were not running with the expected setup, as we were comparing an environment variable against a boolean value ENV['TEST_AUTO_INSTRUMENT'] != true, while the returned value was always a string. This PR addresses that comparison.

@marcotc marcotc added the integrations Involves tracing integrations label May 10, 2021
@marcotc marcotc self-assigned this May 10, 2021
@marcotc marcotc requested a review from a team May 10, 2021 21:32
Copy link
Contributor

@ericmustin ericmustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 lgtm!

@marcotc marcotc merged commit 0bddd77 into master May 11, 2021
@marcotc marcotc deleted the fix/double-init branch May 11, 2021 17:13
@github-actions github-actions bot added this to the 0.49.0 milestone May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants