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

Improve faraday configuration #266

Merged
merged 2 commits into from
Dec 11, 2017
Merged

Improve faraday configuration #266

merged 2 commits into from
Dec 11, 2017

Conversation

p-lambert
Copy link
Member

This PR let's faraday be customized globally and on a per-connection basis.

Setting a global service_name

Datadog.configure do |c|
  c.use :faraday, service_name: 'http'
end

Setting a connection-specific service_name

connection = Faraday.new('http://example.com') do |builder|
  builder.use(:ddtrace, service_name: 'example-request')
end

@palazzem palazzem added enhancement integrations Involves tracing integrations labels Dec 6, 2017
@palazzem palazzem added this to the 0.11.0 milestone Dec 6, 2017
@palazzem palazzem self-requested a review December 6, 2017 00:05
Copy link
Contributor

@palazzem palazzem left a comment

Choose a reason for hiding this comment

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

Just a nitpick, then the approach is exactly what we need.

end

def call(env)
dd_pin.tracer.trace(SERVICE) do |span|
tracer.trace(SERVICE) do |span|
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it be faraday.request or similar? SERVICE is pointing to faraday-request and it's not a SERVICE but an Operation Name.

@p-lambert p-lambert merged commit 58f1836 into master Dec 11, 2017
@delner delner deleted the pedro/faraday-updates branch February 9, 2018 18:52
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