Skip to content

Commit

Permalink
Adds ddtrace gem and configures DataDog (#93)
Browse files Browse the repository at this point in the history
* Adds ddtrace gem and configures DataDog

* Only configure if this environment variable is set
  • Loading branch information
agirlnamedsophia authored and samandmoore committed Nov 29, 2018
1 parent dc32b50 commit ba507f5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ gem 'rack-timeout'
gem 'airbrake', '~> 7.3.5'

gem 'newrelic_rpm'
gem 'ddtrace'

gem 'rails_semantic_logger', require: false

Expand Down
8 changes: 7 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ GEM
db-query-matchers (0.9.0)
activesupport (>= 4.0, <= 6.0)
rspec (~> 3.0)
ddtrace (0.17.2)
msgpack
opentracing (>= 0.4.1)
debug_inspector (0.0.3)
delayed_job (4.1.3)
activesupport (>= 3.0, < 5.2)
Expand Down Expand Up @@ -181,6 +184,7 @@ GEM
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
msgpack (1.2.4)
multi_json (1.13.1)
multipart-post (2.0.0)
neat (1.7.2)
Expand All @@ -198,6 +202,7 @@ GEM
omniauth-saml (1.8.1)
omniauth (~> 1.3)
ruby-saml (~> 1.4, >= 1.4.3)
opentracing (0.4.3)
orm_adapter (0.5.0)
paperclip (5.3.0)
activemodel (>= 4.2.0)
Expand Down Expand Up @@ -409,6 +414,7 @@ DEPENDENCIES
coffee-rails (~> 4.2.0)
database_cleaner
db-query-matchers
ddtrace
delayed_job
delayed_job_active_record
devise
Expand Down Expand Up @@ -450,4 +456,4 @@ DEPENDENCIES
with_transactional_lock

BUNDLED WITH
1.16.5
1.17.1
14 changes: 14 additions & 0 deletions config/initializers/datadog.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
if ENV['DATADOG_ENABLED']
require 'ddtrace'

unless Rails.env.in?(%w(development test))
service_name = Rails.application.class.parent_name.underscore

Datadog.configure do |c|
c.use :rails, service_name: service_name, distributed_tracing: true
c.use :active_record, orm_service_name: "#{service_name}-active_record"
c.use :delayed_job, service_name: "#{service_name}-delayed_job"
c.use :http, service_name: "#{service_name}-http", distributed_tracing: true
end
end
end

0 comments on commit ba507f5

Please sign in to comment.