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

Faraday integration default instrumentation #843

Merged
merged 2 commits into from
Oct 25, 2019

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Oct 21, 2019

Fixes #786

This PR adds a default Faraday middleware handler to allow for ddtrace users to be able to instrument it out-of-the-box, by simply enabling it:

Datadog.configure do |c|
  c.use :faraday
end

Currently we also require users to explicitly configure our middleware on every Faraday connection:

connection = Faraday.new('https://example.com') do |builder|
  builder.use(:ddtrace)
  # ...
end

This per-connection configuration won't be necessary anymore, unless custom configuration settings are desired for that connection.

@marcotc marcotc added bug Involves a bug integrations Involves tracing integrations community Was opened by a community member labels Oct 21, 2019
@marcotc marcotc requested a review from a team October 21, 2019 19:53
@marcotc marcotc self-assigned this Oct 21, 2019
@marcotc marcotc force-pushed the fix/faraday-auto-instrument branch from df7e18f to 66e8dc2 Compare October 21, 2019 20:01
delner
delner previously approved these changes Oct 21, 2019
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

Nice one! Looks good overall; users should be able to use the default instrumentation or connection-specific configuration after this.

One minor issue affecting the tests, but otherwise seems fine to merge to me.

lib/ddtrace/contrib/faraday/patcher.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

👍

@marcotc marcotc merged commit e14b5c7 into master Oct 25, 2019
@marcotc marcotc deleted the fix/faraday-auto-instrument branch October 25, 2019 20:19
@delner delner added this to the 0.29.0 milestone Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Faraday Integration Usage
2 participants