Skip to content

Commit

Permalink
Update datadog to use new ruby library
Browse files Browse the repository at this point in the history
Datadog integration should now also work for staging and profiling is enabled for that only.
  • Loading branch information
richardhallett committed Oct 9, 2024
1 parent e3a4b5d commit 819c267
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gem "countries", "~> 2.1", ">= 2.1.2"
gem "country_select", "~> 3.1"
gem "crawler_detect"
gem "dalli", "~> 3.2", ">= 3.2.8"
gem "ddtrace", require: "ddtrace/auto_instrument"
gem 'datadog', require: 'datadog/auto_instrument'
gem "departure", "~> 6.2"
gem "diffy", "~> 3.2", ">= 3.2.1"
gem "dotenv"
Expand Down
19 changes: 8 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,12 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
datadog-ci (0.6.0)
msgpack
date (3.3.4)
ddtrace (1.19.0)
datadog-ci (~> 0.6.0)
datadog (2.3.0)
debase-ruby_core_source (= 3.3.1)
libdatadog (~> 5.0.0.1.0)
libdatadog (~> 11.0.0.1.0)
libddwaf (~> 1.14.0.0.0)
msgpack
date (3.3.4)
debase-ruby_core_source (3.3.1)
debug_inspector (1.1.0)
departure (6.7.0)
Expand Down Expand Up @@ -418,9 +415,9 @@ GEM
mime-types
terrapin (>= 0.6.0, < 2.0)
latex-decode (0.4.0)
libdatadog (5.0.0.1.0)
libdatadog (5.0.0.1.0-aarch64-linux)
libdatadog (5.0.0.1.0-x86_64-linux)
libdatadog (11.0.0.1.0)
libdatadog (11.0.0.1.0-aarch64-linux)
libdatadog (11.0.0.1.0-x86_64-linux)
libddwaf (1.14.0.0.0-aarch64-linux)
ffi (~> 1.0)
libddwaf (1.14.0.0.0-arm64-darwin)
Expand Down Expand Up @@ -802,7 +799,7 @@ DEPENDENCIES
dalli (~> 3.2, >= 3.2.8)
database_cleaner
database_cleaner-active_record (~> 2.1)
ddtrace
datadog
departure (~> 6.2)
diffy (~> 3.2, >= 3.2.1)
dotenv
Expand Down Expand Up @@ -885,4 +882,4 @@ DEPENDENCIES
webmock (~> 3.18, >= 3.18.1)

BUNDLED WITH
2.5.6
2.5.6
11 changes: 8 additions & 3 deletions config/initializers/datadog.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "ddtrace"
require "datadog"

Datadog.configure do |c|
# Global
Expand All @@ -10,13 +10,18 @@
c.env = Rails.env

# Tracing settings
c.tracing.enabled = Rails.env.production?
c.tracing.analytics.enabled = true

# Enable tracing for production and staging envs
c.tracing.enabled = Rails.env.production? || Rails.env.stage?

# We disable automatic log injection because it doesn't play nice with our formatter
c.tracing.log_injection = false

# Instrumentation
c.tracing.instrument :rails
c.tracing.instrument :elasticsearch
c.tracing.instrument :shoryuken

# Profiling setup
c.profiling.enabled = Rails.env.stage?
end

0 comments on commit 819c267

Please sign in to comment.