Skip to content

Commit

Permalink
add datadog tracing. #276
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 19, 2019
1 parent bdc1cbf commit 5859268
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ gem 'graphql', '~> 1.9', '>= 1.9.4'
gem 'graphql-errors', '~> 0.3.0'
gem 'graphql-batch', '~> 0.4.0'
gem 'graphql-cache', '~> 0.6.0', git: "https://github.com/stackshareio/graphql-cache"
gem 'ddtrace', '~> 0.23.3'

group :development, :test do
gem 'rspec-rails', '~> 3.8', '>= 3.8.2'
Expand Down
17 changes: 10 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
GIT
remote: https://github.com/stackshareio/graphql-cache
revision: 3c3f378ab8061326537ff6be203f6fd46fdf0acd
revision: 290c3297feeb9a4c72c627a3f0992b596628b5d1
specs:
graphql-cache (0.6.0)
graphql (~> 1, > 1.8)

GEM
remote: https://rubygems.org/
specs:
aasm (5.0.4)
aasm (5.0.5)
concurrent-ruby (~> 1.0)
actioncable (5.2.3)
actionpack (= 5.2.3)
Expand Down Expand Up @@ -65,7 +65,7 @@ GEM
audited (4.8.0)
activerecord (>= 4.0, < 5.3)
aws-eventstream (1.0.3)
aws-partitions (1.162.0)
aws-partitions (1.163.0)
aws-sdk-core (3.52.1)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1.0)
Expand All @@ -74,7 +74,7 @@ GEM
aws-sdk-kms (1.20.0)
aws-sdk-core (~> 3, >= 3.52.1)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.38.0)
aws-sdk-s3 (1.39.0)
aws-sdk-core (~> 3, >= 3.52.1)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.0)
Expand Down Expand Up @@ -134,7 +134,7 @@ GEM
builder (3.2.3)
byebug (11.0.1)
cancancan (2.3.0)
capybara (3.20.0)
capybara (3.20.1)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
Expand Down Expand Up @@ -176,6 +176,8 @@ GEM
addressable
dalli (2.7.10)
database_cleaner (1.7.0)
ddtrace (0.23.3)
msgpack
debug_inspector (0.0.3)
diff-lcs (1.3)
diffy (3.3.0)
Expand Down Expand Up @@ -229,7 +231,7 @@ GEM
faraday (>= 0.9)
fast_jsonapi (1.5)
activesupport (>= 4.2)
ffi (1.10.0)
ffi (1.11.0)
flipper (0.16.2)
flipper-active_support_cache_store (0.16.2)
activesupport (>= 3.2, < 6)
Expand All @@ -245,7 +247,7 @@ GEM
promise.rb (~> 0.7.2)
graphql-errors (0.3.0)
graphql (>= 1.6.0, < 2)
haml (5.0.4)
haml (5.1.0)
temple (>= 0.8.0)
tilt
hamster (3.0.0)
Expand Down Expand Up @@ -556,6 +558,7 @@ DEPENDENCIES
country_select (~> 3.1)
dalli (~> 2.7, >= 2.7.6)
database_cleaner
ddtrace (~> 0.23.3)
diffy (~> 3.2, >= 3.2.1)
dotenv
elasticsearch-extensions (~> 0.0.29)
Expand Down
2 changes: 2 additions & 0 deletions app/graphql/lupo_schema.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

class LupoSchema < GraphQL::Schema
use(GraphQL::Tracing::DataDogTracing, analytics_enabled: Rails.env.production?)

default_max_page_size 250
max_depth 10

Expand Down
8 changes: 8 additions & 0 deletions config/initializers/datadog.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

require "ddtrace"

Datadog.configure do |c|
# This will activate auto-instrumentation for Rails
c.use :rails
end

0 comments on commit 5859268

Please sign in to comment.