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

Migrate http to new configuration API #225

Merged
merged 1 commit into from
Oct 30, 2017

Conversation

p-lambert
Copy link
Member

@p-lambert p-lambert commented Oct 17, 2017

Instead of:

require 'net/http'
require 'ddtrace'

Datadog::Monkey.patch_module(:http) # explicitly patch it

client = Net::HTTP.new(host, port)
Datadog::Pin.get_from(client).config = { distributed_tracing_enabled: true }
response = client.get('foo') # trace and send 'x-datadog-trace-id' and 'x-datadog-parent-id'

Now you can:

require 'net/http'
require 'ddtrace'

Datadog.configure do |c|
  c.use :http, distributed_tracing_enabled: true
end

client = Net::HTTP.new(host, port)
response = client.get('foo')

@p-lambert p-lambert changed the base branch from master to pedro/create-configurable-module October 17, 2017 18:32
@p-lambert p-lambert changed the title Migrate http configuration Migrate http to new configuration API Oct 18, 2017
@palazzem palazzem added this to the 0.10.0 milestone Oct 19, 2017
@palazzem palazzem changed the base branch from pedro/create-configurable-module to master October 19, 2017 16:21
@palazzem palazzem self-requested a review October 19, 2017 16:21
@palazzem palazzem added core Involves Datadog core libraries integrations Involves tracing integrations labels Oct 19, 2017
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.

All good to me!


class << self
attr_accessor :distributed_tracing_enabled
# TODO: Remove this once we drop support for legacy configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@palazzem palazzem merged commit 40bdf71 into master Oct 30, 2017
@palazzem palazzem deleted the pedro/migrate-http-configuration branch October 30, 2017 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants