Skip to content

Commit

Permalink
Add Datadog integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Mar 23, 2018
1 parent 5399cb9 commit fe50fa3
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ gem 'blacklight', '6.14.1'
gem 'blacklight-spotlight', github: 'projectblacklight/spotlight', branch: "master"
gem 'solr_wrapper'
gem 'rsolr', '~> 1.0.6'
gem 'ddtrace'
gem 'devise'
gem 'devise-guests', '~> 0.3'
gem 'friendly_id', github: 'norman/friendly_id'
Expand All @@ -79,6 +80,7 @@ gem 'blacklight-oembed'
gem 'devise_invitable'
gem 'iso-639'
gem 'iiif-presentation'
gem 'rails_semantic_logger'
gem 'omniauth-cas'
gem 'sneakers'
gem 'open_uri_redirections'
Expand All @@ -95,7 +97,6 @@ gem 'riiif'
# PUL Assets
gem 'pul-assets', github: 'pulibrary/pul_assets'
# gem 'spotlight-resources-iiif', github: 'pulibrary/spotlight-resources-iiif', branch: 'default_vocab'
gem 'newrelic_rpm'
gem 'dalli'
gem 'ruby-prof', require: false
gem 'honeybadger', '~> 2.0'
Expand Down
12 changes: 10 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ GEM
crass (1.0.3)
dalli (2.7.6)
database_cleaner (1.5.3)
ddtrace (0.11.2)
msgpack
debug_inspector (0.0.2)
declarative (0.0.10)
declarative-option (0.1.0)
Expand Down Expand Up @@ -301,12 +303,12 @@ GEM
mini_portile2 (2.3.0)
minitest (5.11.3)
modernizr-rails (2.7.1)
msgpack (1.2.4)
multi_json (1.12.1)
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (3.2.0)
newrelic_rpm (3.17.2.327)
nio4r (2.2.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
Expand Down Expand Up @@ -373,6 +375,9 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_semantic_logger (4.2.0)
rails (>= 3.2)
semantic_logger (~> 4.1)
railties (5.0.6)
actionpack (= 5.0.6)
activesupport (= 5.0.6)
Expand Down Expand Up @@ -450,6 +455,8 @@ GEM
sdoc (0.4.2)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
semantic_logger (4.2.0)
concurrent-ruby (~> 1.0)
serverengine (1.5.11)
sigdump (~> 0.2.2)
sidekiq (4.2.2)
Expand Down Expand Up @@ -573,6 +580,7 @@ DEPENDENCIES
coveralls
dalli
database_cleaner
ddtrace
devise
devise-guests (~> 0.3)
devise_invitable
Expand All @@ -583,7 +591,6 @@ DEPENDENCIES
iso-639
jbuilder (~> 2.0)
jquery-rails
newrelic_rpm
nokogiri (~> 1.8.1)
omniauth-cas
open_uri_redirections
Expand All @@ -595,6 +602,7 @@ DEPENDENCIES
pul_uv_rails!
rails (~> 5.0)
rails-controller-testing
rails_semantic_logger
redis-namespace
riiif
rsolr (~> 1.0.6)
Expand Down
5 changes: 5 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@ class Application < Rails::Application
# config.i18n.default_locale = :de

config.autoload_paths += %W(#{Rails.root}/app/workers)
config.semantic_logger.backtrace_level = :info
config.rails_semantic_logger.quiet_assets = true
config.rails_semantic_logger.format = :json
config.rails_semantic_logger.rendered = false
config.semantic_logger.application = 'DPUL'
end
end
37 changes: 16 additions & 21 deletions config/initializers/datadog.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
require 'net/http'
require 'redis'
# frozen_string_literal: true
Datadog.configure do |c|
c.tracer(enabled: false) unless Rails.env.production?
# Rails
c.use :rails

if Rails.env.staging? || Rails.env.production?
# require 'sidekiq'
# require 'ddtrace'
# require 'ddtrace/contrib/sidekiq/tracer'
# Rails.configuration.datadog_trace = {
# auto_instrument: true,
# auto_instrument_redis: true,
# default_service: "Plum (#{Rails.env})"
# }
#
# Sidekiq.configure_server do |config|
# config.server_middleware do |chain|
# chain.add(
# Datadog::Contrib::Sidekiq::Tracer,
# sidekiq_service: 'sidekiq'
# )
# end
# end
# Datadog::Monkey.patch_all
# Redis
c.use :redis

# Net::HTTP
c.use :http

# Sidekiq
c.use :sidekiq

# Faraday
c.use :faraday
end

0 comments on commit fe50fa3

Please sign in to comment.