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

feat: setup datadog instrumentation #428

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile3
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ gem "rack-contrib", :git => 'https://github.com/rack/rack-contrib.git', :ref =>


gem "timecop", "~> 0.9.5"
gem 'ddtrace', require: 'ddtrace/auto_instrument'
20 changes: 20 additions & 0 deletions Gemfile3.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ GEM
bigdecimal
rexml
dalli (3.2.8)
datadog-ci (0.8.3)
msgpack
ddtrace (1.21.1)
datadog-ci (~> 0.8.1)
debase-ruby_core_source (= 3.3.1)
libdatadog (~> 6.0.0.2.0)
libddwaf (~> 1.14.0.0.0)
msgpack
debase-ruby_core_source (3.3.1)
delayed_job (4.1.11)
activesupport (>= 3.0, < 8.0)
delayed_job_mongoid (3.0.0)
Expand Down Expand Up @@ -107,6 +116,15 @@ GEM
i18n (1.14.1)
concurrent-ruby (~> 1.0)
kgio (2.11.4)
libdatadog (6.0.0.2.0)
libdatadog (6.0.0.2.0-aarch64-linux)
libdatadog (6.0.0.2.0-x86_64-linux)
libddwaf (1.14.0.0.0-aarch64-linux)
ffi (~> 1.0)
libddwaf (1.14.0.0.0-arm64-darwin)
ffi (~> 1.0)
libddwaf (1.14.0.0.0-x86_64-linux)
ffi (~> 1.0)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand All @@ -128,6 +146,7 @@ GEM
mongoid_magic_counter_cache (1.1.1)
mongoid
rake
msgpack (1.7.2)
multi_json (1.15.0)
multipart-post (2.4.0)
mustermann (3.0.0)
Expand Down Expand Up @@ -235,6 +254,7 @@ DEPENDENCIES
bundler
codecov
dalli
ddtrace
delayed_job
delayed_job_mongoid
elasticsearch (~> 7.8.0)
Expand Down
1 change: 1 addition & 0 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ use Mongoid::QueryCache::Middleware

require './app'
run Sinatra::Application

9 changes: 9 additions & 0 deletions config/unicorn_tcp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
timeout 25
preload_app true

service_name = 'forum'

require 'ddtrace'
# Add Datadog APM configuration
Datadog.configure do |c|
c.tracing.instrument :rails, service_name: service_name
c.tracing.instrument :sinatra, service_name: service_name
end

listen_host = ENV['LISTEN_HOST'] || '0.0.0.0'
listen_port = ENV['LISTEN_PORT'] || '4567'
listen "#{listen_host}:#{listen_port}", :tcp_nopush => true, :backlog => 512
Expand Down
Loading