ddtrace 1.11.0 → 1.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +85 -1
  3. data/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md +6 -4
  4. data/ext/ddtrace_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +34 -16
  5. data/ext/ddtrace_profiling_native_extension/extconf.rb +19 -3
  6. data/ext/ddtrace_profiling_native_extension/native_extension_helpers.rb +2 -2
  7. data/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +38 -4
  8. data/lib/datadog/appsec/assets/blocked.html +1 -1
  9. data/lib/datadog/appsec/assets/waf_rules/recommended.json +489 -133
  10. data/lib/datadog/appsec/assets/waf_rules/strict.json +2 -47
  11. data/lib/datadog/appsec/configuration/settings.rb +2 -10
  12. data/lib/datadog/appsec/configuration.rb +3 -9
  13. data/lib/datadog/appsec/contrib/rack/ext.rb +0 -1
  14. data/lib/datadog/appsec/contrib/rack/gateway/request.rb +17 -3
  15. data/lib/datadog/appsec/contrib/rack/gateway/response.rb +3 -3
  16. data/lib/datadog/appsec/contrib/rack/gateway/watcher.rb +27 -45
  17. data/lib/datadog/appsec/contrib/rack/integration.rb +0 -5
  18. data/lib/datadog/appsec/contrib/rack/reactive/request.rb +7 -1
  19. data/lib/datadog/appsec/contrib/rack/request_body_middleware.rb +1 -1
  20. data/lib/datadog/appsec/contrib/rack/request_middleware.rb +34 -26
  21. data/lib/datadog/appsec/contrib/rails/ext.rb +0 -1
  22. data/lib/datadog/appsec/contrib/rails/framework.rb +1 -13
  23. data/lib/datadog/appsec/contrib/rails/gateway/watcher.rb +9 -27
  24. data/lib/datadog/appsec/contrib/rails/integration.rb +0 -5
  25. data/lib/datadog/appsec/contrib/rails/patcher.rb +1 -1
  26. data/lib/datadog/appsec/contrib/sinatra/ext.rb +0 -1
  27. data/lib/datadog/appsec/contrib/sinatra/framework.rb +1 -13
  28. data/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb +18 -36
  29. data/lib/datadog/appsec/contrib/sinatra/integration.rb +0 -5
  30. data/lib/datadog/appsec/contrib/sinatra/patcher.rb +5 -4
  31. data/lib/datadog/appsec/event.rb +37 -37
  32. data/lib/datadog/appsec/ext.rb +1 -0
  33. data/lib/datadog/appsec/extensions.rb +2 -6
  34. data/lib/datadog/appsec/monitor/gateway/watcher.rb +9 -28
  35. data/lib/datadog/appsec/processor/rule_loader.rb +3 -3
  36. data/lib/datadog/appsec/processor/rule_merger.rb +15 -29
  37. data/lib/datadog/appsec/processor.rb +0 -45
  38. data/lib/datadog/appsec/remote.rb +10 -8
  39. data/lib/datadog/appsec/response.rb +23 -11
  40. data/lib/datadog/appsec/scope.rb +61 -0
  41. data/lib/datadog/appsec.rb +6 -0
  42. data/lib/datadog/ci/ext/environment.rb +40 -4
  43. data/lib/datadog/core/configuration/components.rb +9 -3
  44. data/lib/datadog/core/configuration/settings.rb +74 -14
  45. data/lib/datadog/core/configuration.rb +5 -1
  46. data/lib/datadog/core/remote/client/capabilities.rb +1 -1
  47. data/lib/datadog/core/remote/client.rb +5 -1
  48. data/lib/datadog/core/telemetry/client.rb +1 -1
  49. data/lib/datadog/core/telemetry/collector.rb +2 -1
  50. data/lib/datadog/core/telemetry/http/transport.rb +1 -0
  51. data/lib/datadog/core/telemetry/v1/dependency.rb +2 -1
  52. data/lib/datadog/kit/appsec/events.rb +58 -13
  53. data/lib/datadog/kit/identity.rb +29 -10
  54. data/lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb +2 -0
  55. data/lib/datadog/profiling/component.rb +69 -29
  56. data/lib/datadog/profiling.rb +2 -1
  57. data/lib/datadog/tracing/buffer.rb +0 -1
  58. data/lib/datadog/tracing/contrib/active_support/configuration/settings.rb +9 -1
  59. data/lib/datadog/tracing/contrib/aws/ext.rb +11 -1
  60. data/lib/datadog/tracing/contrib/aws/instrumentation.rb +7 -0
  61. data/lib/datadog/tracing/contrib/aws/parsed_context.rb +4 -0
  62. data/lib/datadog/tracing/contrib/aws/service/base.rb +16 -0
  63. data/lib/datadog/tracing/contrib/aws/service/dynamodb.rb +22 -0
  64. data/lib/datadog/tracing/contrib/aws/service/eventbridge.rb +22 -0
  65. data/lib/datadog/tracing/contrib/aws/service/kinesis.rb +32 -0
  66. data/lib/datadog/tracing/contrib/aws/service/s3.rb +22 -0
  67. data/lib/datadog/tracing/contrib/aws/service/sns.rb +30 -0
  68. data/lib/datadog/tracing/contrib/aws/service/sqs.rb +27 -0
  69. data/lib/datadog/tracing/contrib/aws/service/states.rb +40 -0
  70. data/lib/datadog/tracing/contrib/aws/services.rb +18 -0
  71. data/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +6 -1
  72. data/lib/datadog/tracing/contrib/httpclient/instrumentation.rb +5 -2
  73. data/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +6 -1
  74. data/lib/datadog/tracing/contrib/httprb/instrumentation.rb +4 -2
  75. data/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb +6 -1
  76. data/lib/datadog/tracing/contrib/mongodb/subscribers.rb +5 -2
  77. data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +6 -1
  78. data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +5 -2
  79. data/lib/datadog/tracing/contrib/patcher.rb +0 -1
  80. data/lib/datadog/tracing/contrib/pg/configuration/settings.rb +6 -1
  81. data/lib/datadog/tracing/contrib/pg/instrumentation.rb +5 -2
  82. data/lib/datadog/tracing/contrib/presto/configuration/settings.rb +6 -1
  83. data/lib/datadog/tracing/contrib/presto/instrumentation.rb +4 -2
  84. data/lib/datadog/tracing/contrib/propagation/sql_comment.rb +10 -2
  85. data/lib/datadog/tracing/contrib/racecar/configuration/settings.rb +9 -1
  86. data/lib/datadog/tracing/contrib/racecar/event.rb +3 -1
  87. data/lib/datadog/tracing/contrib/rack/middlewares.rb +3 -1
  88. data/lib/datadog/tracing/contrib/redis/configuration/settings.rb +6 -1
  89. data/lib/datadog/tracing/contrib/redis/tags.rb +4 -1
  90. data/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +6 -1
  91. data/lib/datadog/tracing/contrib/rest_client/request_patch.rb +4 -1
  92. data/lib/datadog/tracing/contrib/roda/patcher.rb +1 -1
  93. data/lib/datadog/tracing/contrib/sequel/database.rb +4 -1
  94. data/lib/datadog/tracing/contrib/sequel/dataset.rb +4 -1
  95. data/lib/datadog/tracing/contrib/sequel/utils.rb +4 -1
  96. data/lib/datadog/tracing/contrib/status_code_matcher.rb +0 -1
  97. data/lib/datadog/tracing/correlation.rb +0 -1
  98. data/lib/datadog/tracing/distributed/headers/ext.rb +1 -1
  99. data/lib/datadog/tracing/event.rb +0 -2
  100. data/lib/datadog/tracing/pipeline.rb +0 -2
  101. data/lib/datadog/tracing/runtime/metrics.rb +0 -2
  102. data/lib/datadog/tracing/sampling/rate_by_service_sampler.rb +0 -1
  103. data/lib/datadog/tracing/sampling/rate_sampler.rb +0 -2
  104. data/lib/datadog/tracing/sampling/rule.rb +0 -2
  105. data/lib/datadog/tracing/sampling/rule_sampler.rb +0 -2
  106. data/lib/datadog/tracing/span_operation.rb +0 -1
  107. data/lib/datadog/tracing/sync_writer.rb +0 -2
  108. data/lib/datadog/tracing/trace_operation.rb +0 -1
  109. data/lib/datadog/tracing/tracer.rb +0 -1
  110. data/lib/datadog/tracing/workers/trace_writer.rb +0 -1
  111. data/lib/datadog/tracing/workers.rb +0 -2
  112. data/lib/datadog/tracing/writer.rb +0 -2
  113. data/lib/ddtrace/version.rb +2 -2
  114. metadata +17 -18
  115. data/lib/datadog/appsec/contrib/configuration/settings.rb +0 -20
  116. data/lib/datadog/appsec/contrib/rack/configuration/settings.rb +0 -22
  117. data/lib/datadog/appsec/contrib/rails/configuration/settings.rb +0 -22
  118. data/lib/datadog/appsec/contrib/sinatra/configuration/settings.rb +0 -22
@@ -1,3 +1,11 @@
1
+ require_relative './service/sqs'
2
+ require_relative './service/sns'
3
+ require_relative './service/dynamodb'
4
+ require_relative './service/kinesis'
5
+ require_relative './service/eventbridge'
6
+ require_relative './service/states'
7
+ require_relative './service/s3'
8
+
1
9
  module Datadog
2
10
  module Tracing
3
11
  module Contrib
@@ -113,6 +121,16 @@ module Datadog
113
121
  WorkSpaces
114
122
  XRay
115
123
  ].freeze
124
+
125
+ SERVICE_HANDLERS = {
126
+ 'sqs' => Service::SQS.new,
127
+ 'sns' => Service::SNS.new,
128
+ 'dynamodb' => Service::DynamoDB.new,
129
+ 'kinesis' => Service::Kinesis.new,
130
+ 'eventbridge' => Service::EventBridge.new,
131
+ 'states' => Service::States.new,
132
+ 's3' => Service::S3.new
133
+ }.freeze
116
134
  end
117
135
  end
118
136
  end
@@ -29,7 +29,12 @@ module Datadog
29
29
  option :distributed_tracing, default: true
30
30
 
31
31
  option :service_name do |o|
32
- o.default { ENV.fetch(Ext::ENV_SERVICE_NAME, Ext::DEFAULT_PEER_SERVICE_NAME) }
32
+ o.default do
33
+ Contrib::SpanAttributeSchema.fetch_service_name(
34
+ Ext::ENV_SERVICE_NAME,
35
+ Ext::DEFAULT_PEER_SERVICE_NAME
36
+ )
37
+ end
33
38
  o.lazy
34
39
  end
35
40
 
@@ -63,8 +63,11 @@ module Datadog
63
63
  span.set_tag(Tracing::Metadata::Ext::NET::TAG_TARGET_HOST, uri.host)
64
64
  span.set_tag(Tracing::Metadata::Ext::NET::TAG_TARGET_PORT, uri.port)
65
65
 
66
- # Tag as an external peer service
67
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
66
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
67
+ # Tag as an external peer service
68
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
69
+ end
70
+
68
71
  span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, uri.host)
69
72
 
70
73
  set_analytics_sample_rate(span, req_options)
@@ -29,7 +29,12 @@ module Datadog
29
29
  option :distributed_tracing, default: true
30
30
 
31
31
  option :service_name do |o|
32
- o.default { ENV.fetch(Ext::ENV_SERVICE_NAME, Ext::DEFAULT_PEER_SERVICE_NAME) }
32
+ o.default do
33
+ Contrib::SpanAttributeSchema.fetch_service_name(
34
+ Ext::ENV_SERVICE_NAME,
35
+ Ext::DEFAULT_PEER_SERVICE_NAME
36
+ )
37
+ end
33
38
  o.lazy
34
39
  end
35
40
 
@@ -73,8 +73,10 @@ module Datadog
73
73
  logger.debug("service #{req_options[:service_name]} span #{Ext::SPAN_REQUEST} missing uri")
74
74
  end
75
75
 
76
- # Tag as an external peer service
77
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
76
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
77
+ # Tag as an external peer service
78
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
79
+ end
78
80
 
79
81
  set_analytics_sample_rate(span, req_options)
80
82
  end
@@ -31,7 +31,12 @@ module Datadog
31
31
  option :quantize, default: DEFAULT_QUANTIZE
32
32
 
33
33
  option :service_name do |o|
34
- o.default { ENV.fetch(Ext::ENV_SERVICE_NAME, Ext::DEFAULT_PEER_SERVICE_NAME) }
34
+ o.default do
35
+ Contrib::SpanAttributeSchema.fetch_service_name(
36
+ Ext::ENV_SERVICE_NAME,
37
+ Ext::DEFAULT_PEER_SERVICE_NAME
38
+ )
39
+ end
35
40
  o.lazy
36
41
  end
37
42
  end
@@ -36,8 +36,11 @@ module Datadog
36
36
  span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
37
37
  span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_COMMAND)
38
38
 
39
- # Tag as an external peer service
40
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
39
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
40
+ # Tag as an external peer service
41
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
42
+ end
43
+
41
44
  span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, event.address.host)
42
45
 
43
46
  # Set analytics sample rate
@@ -29,7 +29,12 @@ module Datadog
29
29
  end
30
30
 
31
31
  option :service_name do |o|
32
- o.default { ENV.fetch(Ext::ENV_SERVICE_NAME, Ext::DEFAULT_PEER_SERVICE_NAME) }
32
+ o.default do
33
+ Contrib::SpanAttributeSchema.fetch_service_name(
34
+ Ext::ENV_SERVICE_NAME,
35
+ Ext::DEFAULT_PEER_SERVICE_NAME
36
+ )
37
+ end
33
38
  o.lazy
34
39
  end
35
40
 
@@ -32,8 +32,11 @@ module Datadog
32
32
  span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
33
33
  span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_QUERY)
34
34
 
35
- # Tag as an external peer service
36
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, service)
35
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
36
+ # Tag as an external peer service
37
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
38
+ end
39
+
37
40
  span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, query_options[:host])
38
41
 
39
42
  # Set analytics sample rate
@@ -1,4 +1,3 @@
1
- require_relative '../../core'
2
1
  require_relative '../../core/utils/only_once'
3
2
 
4
3
  module Datadog
@@ -29,7 +29,12 @@ module Datadog
29
29
  end
30
30
 
31
31
  option :service_name do |o|
32
- o.default { ENV.fetch(Ext::ENV_SERVICE_NAME, Ext::DEFAULT_PEER_SERVICE_NAME) }
32
+ o.default do
33
+ Contrib::SpanAttributeSchema.fetch_service_name(
34
+ Ext::ENV_SERVICE_NAME,
35
+ Ext::DEFAULT_PEER_SERVICE_NAME
36
+ )
37
+ end
33
38
  o.lazy
34
39
  end
35
40
 
@@ -126,8 +126,11 @@ module Datadog
126
126
  span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_QUERY)
127
127
  span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_CLIENT)
128
128
 
129
- # Tag as an external peer service
130
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, service)
129
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
130
+ # Tag as an external peer service
131
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
132
+ end
133
+
131
134
  span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, host)
132
135
 
133
136
  span.set_tag(Contrib::Ext::DB::TAG_INSTANCE, db)
@@ -27,7 +27,12 @@ module Datadog
27
27
  end
28
28
 
29
29
  option :service_name do |o|
30
- o.default { ENV.fetch(Ext::ENV_SERVICE_NAME, Ext::DEFAULT_PEER_SERVICE_NAME) }
30
+ o.default do
31
+ Contrib::SpanAttributeSchema.fetch_service_name(
32
+ Ext::ENV_SERVICE_NAME,
33
+ Ext::DEFAULT_PEER_SERVICE_NAME
34
+ )
35
+ end
31
36
  o.lazy
32
37
  end
33
38
  end
@@ -104,8 +104,10 @@ module Datadog
104
104
  set_nilable_tag!(span, :http_proxy, Ext::TAG_PROXY)
105
105
  set_nilable_tag!(span, :model_version, Ext::TAG_MODEL_VERSION)
106
106
 
107
- # Tag as an external peer service
108
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
107
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
108
+ # Tag as an external peer service
109
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
110
+ end
109
111
 
110
112
  # Set analytics sample rate
111
113
  if Contrib::Analytics.enabled?(datadog_configuration[:analytics_enabled])
@@ -28,8 +28,16 @@ module Datadog
28
28
  }
29
29
 
30
30
  if mode.full?
31
- tags[Ext::KEY_TRACEPARENT] =
32
- Tracing::Distributed::TraceContext.new(fetcher: nil).send(:build_traceparent, trace_op.to_digest)
31
+ # When tracing is disabled, trace_operation is a dummy object that does not contain data to build traceparent
32
+ if datadog_configuration.tracing.enabled
33
+ tags[Ext::KEY_TRACEPARENT] =
34
+ Tracing::Distributed::TraceContext.new(fetcher: nil).send(:build_traceparent, trace_op.to_digest)
35
+ else
36
+ Datadog.logger.warn(
37
+ 'Sql comment propagation with `full` mode is aborted, because tracing is disabled. '\
38
+ 'Please set `Datadog.configuration.tracing.enabled = true` to continue.'
39
+ )
40
+ end
33
41
  end
34
42
 
35
43
  "#{Comment.new(tags)} #{sql}"
@@ -26,7 +26,15 @@ module Datadog
26
26
  o.lazy
27
27
  end
28
28
 
29
- option :service_name, default: Ext::DEFAULT_PEER_SERVICE_NAME
29
+ option :service_name do |o|
30
+ o.default do
31
+ Contrib::SpanAttributeSchema.fetch_service_name(
32
+ '',
33
+ Ext::DEFAULT_PEER_SERVICE_NAME
34
+ )
35
+ end
36
+ o.lazy
37
+ end
30
38
  end
31
39
  end
32
40
  end
@@ -41,7 +41,9 @@ module Datadog
41
41
  span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
42
42
 
43
43
  # Tag as an external peer service
44
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
44
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
45
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
46
+ end
45
47
 
46
48
  # Set analytics sample rate
47
49
  if Contrib::Analytics.enabled?(configuration[:analytics_enabled])
@@ -261,7 +261,9 @@ module Datadog
261
261
  )
262
262
 
263
263
  # Set peer service (so its not believed to belong to this app)
264
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, configuration[:web_service_name])
264
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
265
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, configuration[:web_service_name])
266
+ end
265
267
 
266
268
  span
267
269
  end
@@ -32,7 +32,12 @@ module Datadog
32
32
  end
33
33
 
34
34
  option :service_name do |o|
35
- o.default { ENV.fetch(Ext::ENV_SERVICE_NAME, Ext::DEFAULT_PEER_SERVICE_NAME) }
35
+ o.default do
36
+ Contrib::SpanAttributeSchema.fetch_service_name(
37
+ Ext::ENV_SERVICE_NAME,
38
+ Ext::DEFAULT_PEER_SERVICE_NAME
39
+ )
40
+ end
36
41
  o.lazy
37
42
  end
38
43
  end
@@ -17,7 +17,10 @@ module Datadog
17
17
  span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_COMMAND)
18
18
 
19
19
  # Tag as an external peer service
20
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
20
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
21
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
22
+ end
23
+
21
24
  span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, client.host)
22
25
 
23
26
  span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_CLIENT)
@@ -29,7 +29,12 @@ module Datadog
29
29
  option :distributed_tracing, default: true
30
30
 
31
31
  option :service_name do |o|
32
- o.default { ENV.fetch(Ext::ENV_SERVICE_NAME, Ext::DEFAULT_PEER_SERVICE_NAME) }
32
+ o.default do
33
+ Contrib::SpanAttributeSchema.fetch_service_name(
34
+ Ext::ENV_SERVICE_NAME,
35
+ Ext::DEFAULT_PEER_SERVICE_NAME
36
+ )
37
+ end
33
38
  o.lazy
34
39
  end
35
40
 
@@ -40,7 +40,10 @@ module Datadog
40
40
  span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_REQUEST)
41
41
 
42
42
  # Tag as an external peer service
43
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
43
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
44
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
45
+ end
46
+
44
47
  span.set_tag(Tracing::Metadata::Ext::TAG_PEER_HOSTNAME, uri.host)
45
48
 
46
49
  # Set analytics sample rate
@@ -2,7 +2,7 @@
2
2
 
3
3
  # typed: ignore
4
4
 
5
- require_relative 'patcher'
5
+ require_relative '../patcher'
6
6
  require_relative 'ext'
7
7
  require_relative 'instrumentation'
8
8
 
@@ -23,7 +23,10 @@ module Datadog
23
23
  Tracing.trace(Ext::SPAN_QUERY) do |span|
24
24
  span.service = Datadog.configuration_for(self, :service_name) \
25
25
  || Datadog.configuration.tracing[:sequel][:service_name] \
26
- || adapter_name
26
+ || Contrib::SpanAttributeSchema.fetch_service_name(
27
+ '',
28
+ adapter_name
29
+ )
27
30
  span.resource = opts[:query]
28
31
  span.span_type = Tracing::Metadata::Ext::SQL::TYPE
29
32
  Utils.set_common_tags(span, self)
@@ -42,7 +42,10 @@ module Datadog
42
42
  Tracing.trace(Ext::SPAN_QUERY) do |span|
43
43
  span.service = Datadog.configuration_for(db, :service_name) \
44
44
  || Datadog.configuration.tracing[:sequel][:service_name] \
45
- || adapter_name
45
+ || Contrib::SpanAttributeSchema.fetch_service_name(
46
+ '',
47
+ adapter_name
48
+ )
46
49
  span.resource = opts[:query]
47
50
  span.span_type = Tracing::Metadata::Ext::SQL::TYPE
48
51
  Utils.set_common_tags(span, db)
@@ -53,7 +53,10 @@ module Datadog
53
53
  span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_QUERY)
54
54
 
55
55
  # Tag as an external peer service
56
- span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
56
+ if Contrib::SpanAttributeSchema.default_span_attribute_schema?
57
+ span.set_tag(Tracing::Metadata::Ext::TAG_PEER_SERVICE, span.service)
58
+ end
59
+
57
60
  # TODO: Extract host for Sequel with JDBC. The easiest way seem to be through
58
61
  # TODO: the database URI. Unfortunately, JDBC URIs do not work with `URI.parse`.
59
62
  # host, _port = extract_host_port_from_uri(db.uri)
@@ -1,6 +1,5 @@
1
1
  require 'set'
2
2
 
3
- require_relative '../../core'
4
3
  require_relative '../metadata/ext'
5
4
 
6
5
  module Datadog
@@ -1,4 +1,3 @@
1
- require_relative '../core'
2
1
  require_relative 'utils'
3
2
  require_relative 'metadata/ext'
4
3
 
@@ -5,7 +5,7 @@ module Datadog
5
5
  module Distributed
6
6
  module Headers
7
7
  # DEV-2.0: This module only exists for backwards compatibility with the public API. It should be removed.
8
- # @deprecated use [Datadog::Tracing::Distributed::Ext]
8
+ # @deprecated use [Datadog::Tracing::Distributed::Datadog] and [Datadog::Tracing::Distributed::B3]
9
9
  # @public_api
10
10
  module Ext
11
11
  HTTP_HEADER_TRACE_ID = 'x-datadog-trace-id'
@@ -1,5 +1,3 @@
1
- require_relative '../core'
2
-
3
1
  module Datadog
4
2
  module Tracing
5
3
  # Event behavior and DSL
@@ -1,5 +1,3 @@
1
- require_relative '../core'
2
-
3
1
  require_relative 'pipeline/span_filter'
4
2
  require_relative 'pipeline/span_processor'
5
3
 
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../../core'
4
-
5
3
  module Datadog
6
4
  module Tracing
7
5
  module Runtime
@@ -1,4 +1,3 @@
1
- require_relative '../../core'
2
1
  require_relative 'rate_by_key_sampler'
3
2
 
4
3
  module Datadog
@@ -1,5 +1,3 @@
1
- require_relative '../../core'
2
-
3
1
  require_relative 'sampler'
4
2
  require_relative '../utils'
5
3
 
@@ -1,5 +1,3 @@
1
- require_relative '../../core'
2
-
3
1
  require_relative 'matcher'
4
2
  require_relative 'rate_sampler'
5
3
 
@@ -1,5 +1,3 @@
1
- require_relative '../../core'
2
-
3
1
  require_relative 'ext'
4
2
  require_relative 'rate_limiter'
5
3
  require_relative 'rule'
@@ -1,6 +1,5 @@
1
1
  require 'time'
2
2
 
3
- require_relative '../core'
4
3
  require_relative '../core/environment/identity'
5
4
  require_relative '../core/utils'
6
5
  require_relative '../core/utils/time'
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../core'
4
-
5
3
  require_relative 'pipeline'
6
4
  require_relative 'runtime/metrics'
7
5
  require_relative 'writer'
@@ -1,4 +1,3 @@
1
- require_relative '../core'
2
1
  require_relative '../core/environment/identity'
3
2
  require_relative '../core/utils'
4
3
 
@@ -1,4 +1,3 @@
1
- require_relative '../core'
2
1
  require_relative '../core/environment/ext'
3
2
  require_relative '../core/environment/socket'
4
3
 
@@ -1,4 +1,3 @@
1
- require_relative '../../core'
2
1
  require_relative '../../core/worker'
3
2
  require_relative '../../core/workers/async'
4
3
  require_relative '../../core/workers/polling'
@@ -1,5 +1,3 @@
1
- require_relative '../core'
2
-
3
1
  require_relative 'buffer'
4
2
  require_relative 'pipeline'
5
3
 
@@ -1,5 +1,3 @@
1
- require_relative '../core'
2
-
3
1
  require_relative 'event'
4
2
  require_relative 'runtime/metrics'
5
3
  require_relative 'workers'
@@ -3,8 +3,8 @@
3
3
  module DDTrace
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 11
7
- PATCH = 0
6
+ MINOR = 12
7
+ PATCH = 1
8
8
  PRE = nil
9
9
  BUILD = nil
10
10
  # PRE and BUILD above are modified for dev gems during gem build GHA workflow
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddtrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-27 00:00:00.000000000 Z
11
+ date: 2023-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -28,36 +28,30 @@ dependencies:
28
28
  name: debase-ruby_core_source
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 0.10.16
34
- - - "<="
31
+ - - '='
35
32
  - !ruby/object:Gem::Version
36
- version: 3.2.0
33
+ version: 3.2.1
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 0.10.16
44
- - - "<="
38
+ - - '='
45
39
  - !ruby/object:Gem::Version
46
- version: 3.2.0
40
+ version: 3.2.1
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: libddwaf
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: 1.8.2.0.0
47
+ version: 1.9.0.0.0
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: 1.8.2.0.0
54
+ version: 1.9.0.0.0
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: libdatadog
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -137,10 +131,8 @@ files:
137
131
  - lib/datadog/appsec/configuration.rb
138
132
  - lib/datadog/appsec/configuration/settings.rb
139
133
  - lib/datadog/appsec/contrib/auto_instrument.rb
140
- - lib/datadog/appsec/contrib/configuration/settings.rb
141
134
  - lib/datadog/appsec/contrib/integration.rb
142
135
  - lib/datadog/appsec/contrib/patcher.rb
143
- - lib/datadog/appsec/contrib/rack/configuration/settings.rb
144
136
  - lib/datadog/appsec/contrib/rack/ext.rb
145
137
  - lib/datadog/appsec/contrib/rack/gateway/request.rb
146
138
  - lib/datadog/appsec/contrib/rack/gateway/response.rb
@@ -152,7 +144,6 @@ files:
152
144
  - lib/datadog/appsec/contrib/rack/reactive/response.rb
153
145
  - lib/datadog/appsec/contrib/rack/request_body_middleware.rb
154
146
  - lib/datadog/appsec/contrib/rack/request_middleware.rb
155
- - lib/datadog/appsec/contrib/rails/configuration/settings.rb
156
147
  - lib/datadog/appsec/contrib/rails/ext.rb
157
148
  - lib/datadog/appsec/contrib/rails/framework.rb
158
149
  - lib/datadog/appsec/contrib/rails/gateway/request.rb
@@ -162,7 +153,6 @@ files:
162
153
  - lib/datadog/appsec/contrib/rails/reactive/action.rb
163
154
  - lib/datadog/appsec/contrib/rails/request.rb
164
155
  - lib/datadog/appsec/contrib/rails/request_middleware.rb
165
- - lib/datadog/appsec/contrib/sinatra/configuration/settings.rb
166
156
  - lib/datadog/appsec/contrib/sinatra/ext.rb
167
157
  - lib/datadog/appsec/contrib/sinatra/framework.rb
168
158
  - lib/datadog/appsec/contrib/sinatra/gateway/request.rb
@@ -191,6 +181,7 @@ files:
191
181
  - lib/datadog/appsec/reactive/subscriber.rb
192
182
  - lib/datadog/appsec/remote.rb
193
183
  - lib/datadog/appsec/response.rb
184
+ - lib/datadog/appsec/scope.rb
194
185
  - lib/datadog/appsec/utils.rb
195
186
  - lib/datadog/appsec/utils/http.rb
196
187
  - lib/datadog/appsec/utils/http/media_range.rb
@@ -497,6 +488,14 @@ files:
497
488
  - lib/datadog/tracing/contrib/aws/integration.rb
498
489
  - lib/datadog/tracing/contrib/aws/parsed_context.rb
499
490
  - lib/datadog/tracing/contrib/aws/patcher.rb
491
+ - lib/datadog/tracing/contrib/aws/service/base.rb
492
+ - lib/datadog/tracing/contrib/aws/service/dynamodb.rb
493
+ - lib/datadog/tracing/contrib/aws/service/eventbridge.rb
494
+ - lib/datadog/tracing/contrib/aws/service/kinesis.rb
495
+ - lib/datadog/tracing/contrib/aws/service/s3.rb
496
+ - lib/datadog/tracing/contrib/aws/service/sns.rb
497
+ - lib/datadog/tracing/contrib/aws/service/sqs.rb
498
+ - lib/datadog/tracing/contrib/aws/service/states.rb
500
499
  - lib/datadog/tracing/contrib/aws/services.rb
501
500
  - lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb
502
501
  - lib/datadog/tracing/contrib/concurrent_ruby/context_composite_executor_service.rb