ddtrace 0.38.0 → 0.39.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/Appraisals +29 -5
  3. data/CHANGELOG.md +31 -1
  4. data/Rakefile +69 -66
  5. data/docs/GettingStarted.md +85 -50
  6. data/lib/ddtrace.rb +1 -0
  7. data/lib/ddtrace/configuration/settings.rb +9 -3
  8. data/lib/ddtrace/contrib/action_cable/configuration/settings.rb +7 -2
  9. data/lib/ddtrace/contrib/action_cable/ext.rb +5 -2
  10. data/lib/ddtrace/contrib/action_pack/action_controller/instrumentation.rb +7 -0
  11. data/lib/ddtrace/contrib/action_pack/configuration/settings.rb +7 -2
  12. data/lib/ddtrace/contrib/action_pack/ext.rb +5 -2
  13. data/lib/ddtrace/contrib/action_view/configuration/settings.rb +7 -2
  14. data/lib/ddtrace/contrib/action_view/ext.rb +5 -2
  15. data/lib/ddtrace/contrib/active_model_serializers/configuration/settings.rb +7 -2
  16. data/lib/ddtrace/contrib/active_model_serializers/ext.rb +5 -2
  17. data/lib/ddtrace/contrib/active_record/configuration/settings.rb +7 -2
  18. data/lib/ddtrace/contrib/active_record/ext.rb +5 -2
  19. data/lib/ddtrace/contrib/active_support/configuration/settings.rb +7 -2
  20. data/lib/ddtrace/contrib/active_support/ext.rb +5 -2
  21. data/lib/ddtrace/contrib/aws/configuration/settings.rb +7 -2
  22. data/lib/ddtrace/contrib/aws/ext.rb +5 -2
  23. data/lib/ddtrace/contrib/concurrent_ruby/configuration/settings.rb +5 -0
  24. data/lib/ddtrace/contrib/concurrent_ruby/ext.rb +1 -0
  25. data/lib/ddtrace/contrib/configuration/settings.rb +1 -0
  26. data/lib/ddtrace/contrib/dalli/configuration/settings.rb +7 -2
  27. data/lib/ddtrace/contrib/dalli/ext.rb +5 -2
  28. data/lib/ddtrace/contrib/delayed_job/configuration/settings.rb +7 -2
  29. data/lib/ddtrace/contrib/delayed_job/ext.rb +5 -2
  30. data/lib/ddtrace/contrib/elasticsearch/configuration/settings.rb +7 -2
  31. data/lib/ddtrace/contrib/elasticsearch/ext.rb +5 -2
  32. data/lib/ddtrace/contrib/ethon/configuration/settings.rb +7 -2
  33. data/lib/ddtrace/contrib/ethon/ext.rb +5 -2
  34. data/lib/ddtrace/contrib/excon/configuration/settings.rb +7 -2
  35. data/lib/ddtrace/contrib/excon/ext.rb +5 -2
  36. data/lib/ddtrace/contrib/extensions.rb +1 -1
  37. data/lib/ddtrace/contrib/faraday/configuration/settings.rb +7 -2
  38. data/lib/ddtrace/contrib/faraday/ext.rb +5 -2
  39. data/lib/ddtrace/contrib/faraday/patcher.rb +12 -3
  40. data/lib/ddtrace/contrib/grape/configuration/settings.rb +7 -3
  41. data/lib/ddtrace/contrib/grape/ext.rb +5 -2
  42. data/lib/ddtrace/contrib/graphql/configuration/settings.rb +7 -2
  43. data/lib/ddtrace/contrib/graphql/ext.rb +5 -2
  44. data/lib/ddtrace/contrib/grpc/configuration/settings.rb +7 -2
  45. data/lib/ddtrace/contrib/grpc/ext.rb +5 -2
  46. data/lib/ddtrace/contrib/http/configuration/settings.rb +7 -2
  47. data/lib/ddtrace/contrib/http/ext.rb +5 -2
  48. data/lib/ddtrace/contrib/httprb/configuration/settings.rb +7 -2
  49. data/lib/ddtrace/contrib/httprb/ext.rb +5 -2
  50. data/lib/ddtrace/contrib/httprb/instrumentation.rb +3 -6
  51. data/lib/ddtrace/contrib/kafka/configuration/settings.rb +7 -2
  52. data/lib/ddtrace/contrib/kafka/ext.rb +5 -2
  53. data/lib/ddtrace/contrib/mongodb/configuration/settings.rb +7 -2
  54. data/lib/ddtrace/contrib/mongodb/ext.rb +5 -2
  55. data/lib/ddtrace/contrib/mysql2/configuration/settings.rb +7 -2
  56. data/lib/ddtrace/contrib/mysql2/ext.rb +5 -2
  57. data/lib/ddtrace/contrib/presto/configuration/settings.rb +7 -2
  58. data/lib/ddtrace/contrib/presto/ext.rb +5 -2
  59. data/lib/ddtrace/contrib/racecar/configuration/settings.rb +7 -2
  60. data/lib/ddtrace/contrib/racecar/ext.rb +5 -2
  61. data/lib/ddtrace/contrib/rack/configuration/settings.rb +7 -2
  62. data/lib/ddtrace/contrib/rack/ext.rb +5 -2
  63. data/lib/ddtrace/contrib/rails/configuration/settings.rb +7 -2
  64. data/lib/ddtrace/contrib/rails/ext.rb +5 -2
  65. data/lib/ddtrace/contrib/rake/configuration/settings.rb +7 -3
  66. data/lib/ddtrace/contrib/rake/ext.rb +5 -2
  67. data/lib/ddtrace/contrib/redis/configuration/settings.rb +7 -2
  68. data/lib/ddtrace/contrib/redis/ext.rb +5 -2
  69. data/lib/ddtrace/contrib/resque/configuration/settings.rb +7 -2
  70. data/lib/ddtrace/contrib/resque/ext.rb +5 -2
  71. data/lib/ddtrace/contrib/rest_client/configuration/settings.rb +7 -2
  72. data/lib/ddtrace/contrib/rest_client/ext.rb +5 -2
  73. data/lib/ddtrace/contrib/sequel/configuration/settings.rb +7 -2
  74. data/lib/ddtrace/contrib/sequel/ext.rb +5 -2
  75. data/lib/ddtrace/contrib/sequel/utils.rb +19 -1
  76. data/lib/ddtrace/contrib/shoryuken/configuration/settings.rb +7 -2
  77. data/lib/ddtrace/contrib/shoryuken/ext.rb +5 -2
  78. data/lib/ddtrace/contrib/sidekiq/configuration/settings.rb +7 -2
  79. data/lib/ddtrace/contrib/sidekiq/ext.rb +5 -2
  80. data/lib/ddtrace/contrib/sinatra/configuration/settings.rb +7 -2
  81. data/lib/ddtrace/contrib/sinatra/ext.rb +5 -2
  82. data/lib/ddtrace/contrib/sneakers/configuration/settings.rb +32 -0
  83. data/lib/ddtrace/contrib/sneakers/ext.rb +22 -0
  84. data/lib/ddtrace/contrib/sneakers/integration.rb +41 -0
  85. data/lib/ddtrace/contrib/sneakers/patcher.rb +24 -0
  86. data/lib/ddtrace/contrib/sneakers/tracer.rb +58 -0
  87. data/lib/ddtrace/contrib/sucker_punch/configuration/settings.rb +7 -2
  88. data/lib/ddtrace/contrib/sucker_punch/ext.rb +5 -2
  89. data/lib/ddtrace/diagnostics/environment_logger.rb +1 -1
  90. data/lib/ddtrace/environment.rb +14 -4
  91. data/lib/ddtrace/ext/diagnostics.rb +2 -1
  92. data/lib/ddtrace/ext/transport.rb +1 -0
  93. data/lib/ddtrace/logger.rb +1 -1
  94. data/lib/ddtrace/runtime/metrics.rb +18 -4
  95. data/lib/ddtrace/transport/http.rb +15 -0
  96. data/lib/ddtrace/transport/http/adapters/test.rb +2 -0
  97. data/lib/ddtrace/version.rb +1 -1
  98. metadata +36 -46
@@ -72,5 +72,6 @@ require 'ddtrace/contrib/sequel/integration'
72
72
  require 'ddtrace/contrib/shoryuken/integration'
73
73
  require 'ddtrace/contrib/sidekiq/integration'
74
74
  require 'ddtrace/contrib/sinatra/integration'
75
+ require 'ddtrace/contrib/sneakers/integration'
75
76
  require 'ddtrace/contrib/sucker_punch/integration'
76
77
  require 'ddtrace/monkey'
@@ -37,7 +37,10 @@ module Datadog
37
37
  end
38
38
 
39
39
  settings :diagnostics do
40
- option :debug, default: false
40
+ option :debug do |o|
41
+ o.default { env_to_bool(Datadog::Ext::Diagnostics::DD_TRACE_DEBUG, false) }
42
+ o.lazy
43
+ end
41
44
 
42
45
  settings :health_metrics do
43
46
  option :enabled do |o|
@@ -92,7 +95,7 @@ module Datadog
92
95
  o.on_set { |value| set_option(:level, value.level) unless value.nil? }
93
96
  end
94
97
 
95
- option :level, default: ::Logger::WARN
98
+ option :level, default: ::Logger::INFO
96
99
  end
97
100
 
98
101
  def logger=(logger)
@@ -198,7 +201,10 @@ module Datadog
198
201
  end
199
202
 
200
203
  settings :tracer do
201
- option :enabled, default: true
204
+ option :enabled do |o|
205
+ o.default { env_to_bool(Datadog::Ext::Diagnostics::DD_TRACE_ENABLED, true) }
206
+ o.lazy
207
+ end
202
208
  option :hostname # TODO: Deprecate
203
209
  option :instance
204
210
 
@@ -7,13 +7,18 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the ActionCable integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :analytics_enabled do |o|
11
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
16
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
12
17
  o.lazy
13
18
  end
14
19
 
15
20
  option :analytics_sample_rate do |o|
16
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
21
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
17
22
  o.lazy
18
23
  end
19
24
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # ActionCable integration constants
5
5
  module Ext
6
6
  APP = 'action_cable'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_ACTION_CABLE_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTION_CABLE_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_ACTION_CABLE_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_CABLE_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTION_CABLE_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_CABLE_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTION_CABLE_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  SERVICE_NAME = 'action_cable'.freeze
10
13
  SPAN_ACTION = 'action_cable.action'.freeze
11
14
  SPAN_BROADCAST = 'action_cable.broadcast'.freeze
@@ -66,6 +66,13 @@ module Datadog
66
66
  span.status = 1 if status.starts_with?('5')
67
67
  elsif Utils.exception_is_error?(exception)
68
68
  span.set_error(exception)
69
+
70
+ # Some exception gets handled by Rails middleware before it can be set on Rack middleware
71
+ # The rack span is the root span of the request and should make sure it has the full exception
72
+ # set on it.
73
+ if env[:datadog_rack_request_span]
74
+ env[:datadog_rack_request_span].set_error(exception)
75
+ end
69
76
  end
70
77
  ensure
71
78
  span.finish
@@ -7,13 +7,18 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the ActionPack integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :analytics_enabled do |o|
11
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, nil) }
16
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], nil) }
12
17
  o.lazy
13
18
  end
14
19
 
15
20
  option :analytics_sample_rate do |o|
16
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
21
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
17
22
  o.lazy
18
23
  end
19
24
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # ActionPack integration constants
5
5
  module Ext
6
6
  APP = 'action_pack'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_ACTION_PACK_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTION_PACK_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_ACTION_PACK_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_PACK_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTION_PACK_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_PACK_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTION_PACK_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  SERVICE_NAME = 'action_pack'.freeze
10
13
  SPAN_ACTION_CONTROLLER = 'rails.action_controller'.freeze
11
14
  TAG_ROUTE_ACTION = 'rails.route.action'.freeze
@@ -7,13 +7,18 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the ActionView integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :analytics_enabled do |o|
11
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
16
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
12
17
  o.lazy
13
18
  end
14
19
 
15
20
  option :analytics_sample_rate do |o|
16
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
21
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
17
22
  o.lazy
18
23
  end
19
24
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # ActionView integration constants
5
5
  module Ext
6
6
  APP = 'action_view'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_ACTION_VIEW_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTION_VIEW_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_ACTION_VIEW_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTION_VIEW_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTION_VIEW_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTION_VIEW_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTION_VIEW_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  SERVICE_NAME = 'action_view'.freeze
10
13
  SPAN_RENDER_PARTIAL = 'rails.render_partial'.freeze
11
14
  SPAN_RENDER_TEMPLATE = 'rails.render_template'.freeze
@@ -7,13 +7,18 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the ActiveModelSerializers integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :analytics_enabled do |o|
11
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
16
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
12
17
  o.lazy
13
18
  end
14
19
 
15
20
  option :analytics_sample_rate do |o|
16
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
21
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
17
22
  o.lazy
18
23
  end
19
24
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # ActiveModelSerializers integration constants
5
5
  module Ext
6
6
  APP = 'active_model_serializers'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTIVE_MODEL_SERIALIZERS_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  SERVICE_NAME = 'active_model_serializers'.freeze
10
13
  SPAN_RENDER = 'active_model_serializers.render'.freeze
11
14
  SPAN_SERIALIZE = 'active_model_serializers.serialize'.freeze
@@ -8,13 +8,18 @@ module Datadog
8
8
  module Configuration
9
9
  # Custom settings for the ActiveRecord integration
10
10
  class Settings < Contrib::Configuration::Settings
11
+ option :enabled do |o|
12
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
13
+ o.lazy
14
+ end
15
+
11
16
  option :analytics_enabled do |o|
12
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
17
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
13
18
  o.lazy
14
19
  end
15
20
 
16
21
  option :analytics_sample_rate do |o|
17
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
22
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
18
23
  o.lazy
19
24
  end
20
25
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # ActiveRecord integration constants
5
5
  module Ext
6
6
  APP = 'active_record'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_ACTIVE_RECORD_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTIVE_RECORD_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_ACTIVE_RECORD_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_RECORD_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTIVE_RECORD_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_RECORD_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTIVE_RECORD_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  SERVICE_NAME = 'active_record'.freeze
10
13
  SPAN_INSTANTIATION = 'active_record.instantiation'.freeze
11
14
  SPAN_SQL = 'active_record.sql'.freeze
@@ -7,13 +7,18 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the ActiveSupport integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :analytics_enabled do |o|
11
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
16
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
12
17
  o.lazy
13
18
  end
14
19
 
15
20
  option :analytics_sample_rate do |o|
16
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
21
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
17
22
  o.lazy
18
23
  end
19
24
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # ActiveSupport integration constants
5
5
  module Ext
6
6
  APP = 'active_support'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_ACTIVE_SUPPORT_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_ACTIVE_SUPPORT_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_ACTIVE_SUPPORT_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_ACTIVE_SUPPORT_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_ACTIVE_SUPPORT_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ACTIVE_SUPPORT_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ACTIVE_SUPPORT_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  QUANTIZE_CACHE_MAX_KEY_SIZE = 300
10
13
  RESOURCE_CACHE_DELETE = 'DELETE'.freeze
11
14
  RESOURCE_CACHE_GET = 'GET'.freeze
@@ -7,13 +7,18 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the AWS integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :analytics_enabled do |o|
11
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
16
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
12
17
  o.lazy
13
18
  end
14
19
 
15
20
  option :analytics_sample_rate do |o|
16
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
21
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
17
22
  o.lazy
18
23
  end
19
24
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # AWS integration constants
5
5
  module Ext
6
6
  APP = 'aws'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_AWS_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_AWS_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_AWS_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_AWS_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_AWS_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_AWS_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_AWS_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  SERVICE_NAME = 'aws'.freeze
10
13
  SPAN_COMMAND = 'aws.command'.freeze
11
14
  TAG_AGENT = 'aws.agent'.freeze
@@ -7,6 +7,11 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the ConcurrentRuby integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :service_name, default: Ext::SERVICE_NAME
11
16
  end
12
17
  end
@@ -5,6 +5,7 @@ module Datadog
5
5
  module Ext
6
6
  APP = 'concurrent-ruby'.freeze
7
7
  SERVICE_NAME = 'concurrent-ruby'.freeze
8
+ ENV_ENABLED = 'DD_TRACE_CONCURRENT_RUBY_ENABLED'.freeze
8
9
  end
9
10
  end
10
11
  end
@@ -9,6 +9,7 @@ module Datadog
9
9
 
10
10
  option :analytics_enabled, default: false
11
11
  option :analytics_sample_rate, default: 1.0
12
+ option :enabled, default: true
12
13
  option :service_name
13
14
  option :tracer do |o|
14
15
  o.delegate_to { Datadog.tracer }
@@ -7,13 +7,18 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the Dalli integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :analytics_enabled do |o|
11
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
16
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
12
17
  o.lazy
13
18
  end
14
19
 
15
20
  option :analytics_sample_rate do |o|
16
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
21
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
17
22
  o.lazy
18
23
  end
19
24
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # Dalli integration constants
5
5
  module Ext
6
6
  APP = 'dalli'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_DALLI_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_DALLI_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_DALLI_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_DALLI_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_DALLI_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_DALLI_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_DALLI_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  QUANTIZE_MAX_CMD_LENGTH = 100
10
13
  SERVICE_NAME = 'memcached'.freeze
11
14
  SPAN_COMMAND = 'memcached.command'.freeze
@@ -7,13 +7,18 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the DelayedJob integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :analytics_enabled do |o|
11
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
16
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
12
17
  o.lazy
13
18
  end
14
19
 
15
20
  option :analytics_sample_rate do |o|
16
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
21
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
17
22
  o.lazy
18
23
  end
19
24
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # DelayedJob integration constants
5
5
  module Ext
6
6
  APP = 'delayed_job'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_DELAYED_JOB_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_DELAYED_JOB_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_DELAYED_JOB_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_DELAYED_JOB_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_DELAYED_JOB_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_DELAYED_JOB_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_DELAYED_JOB_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  SERVICE_NAME = 'delayed_job'.freeze
10
13
  SPAN_JOB = 'delayed_job'.freeze
11
14
  TAG_ATTEMPTS = 'delayed_job.attempts'.freeze
@@ -7,13 +7,18 @@ module Datadog
7
7
  module Configuration
8
8
  # Custom settings for the Elasticsearch integration
9
9
  class Settings < Contrib::Configuration::Settings
10
+ option :enabled do |o|
11
+ o.default { env_to_bool(Ext::ENV_ENABLED, true) }
12
+ o.lazy
13
+ end
14
+
10
15
  option :analytics_enabled do |o|
11
- o.default { env_to_bool(Ext::ENV_ANALYTICS_ENABLED, false) }
16
+ o.default { env_to_bool([Ext::ENV_ANALYTICS_ENABLED, Ext::ENV_ANALYTICS_ENABLED_OLD], false) }
12
17
  o.lazy
13
18
  end
14
19
 
15
20
  option :analytics_sample_rate do |o|
16
- o.default { env_to_float(Ext::ENV_ANALYTICS_SAMPLE_RATE, 1.0) }
21
+ o.default { env_to_float([Ext::ENV_ANALYTICS_SAMPLE_RATE, Ext::ENV_ANALYTICS_SAMPLE_RATE_OLD], 1.0) }
17
22
  o.lazy
18
23
  end
19
24
 
@@ -4,8 +4,11 @@ module Datadog
4
4
  # Elasticsearch integration constants
5
5
  module Ext
6
6
  APP = 'elasticsearch'.freeze
7
- ENV_ANALYTICS_ENABLED = 'DD_ELASTICSEARCH_ANALYTICS_ENABLED'.freeze
8
- ENV_ANALYTICS_SAMPLE_RATE = 'DD_ELASTICSEARCH_ANALYTICS_SAMPLE_RATE'.freeze
7
+ ENV_ENABLED = 'DD_TRACE_ELASTICSEARCH_ENABLED'.freeze
8
+ ENV_ANALYTICS_ENABLED = 'DD_TRACE_ELASTICSEARCH_ANALYTICS_ENABLED'.freeze
9
+ ENV_ANALYTICS_ENABLED_OLD = 'DD_ELASTICSEARCH_ANALYTICS_ENABLED'.freeze
10
+ ENV_ANALYTICS_SAMPLE_RATE = 'DD_TRACE_ELASTICSEARCH_ANALYTICS_SAMPLE_RATE'.freeze
11
+ ENV_ANALYTICS_SAMPLE_RATE_OLD = 'DD_ELASTICSEARCH_ANALYTICS_SAMPLE_RATE'.freeze
9
12
  SERVICE_NAME = 'elasticsearch'.freeze
10
13
  SPAN_QUERY = 'elasticsearch.query'.freeze
11
14
  SPAN_TYPE_QUERY = 'elasticsearch'.freeze