sqreen 1.25.0 → 1.25.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91d799812d8133a1915b8174bc71b1986028bbea556ed445cc8bd8c240176d96
4
- data.tar.gz: d7f9e221109affd64736c772f030ba618dba20cdbaac1b5369772e2d151b12ff
3
+ metadata.gz: 6328da058ba9dbd5f216152de2a9751d3d967a2f4d65304032137849a8b10d25
4
+ data.tar.gz: 7835057ef1b3c18d6995136c6d7c10ed6168bb9f42be32d91959518bcbe287cf
5
5
  SHA512:
6
- metadata.gz: 996a203e716bb890c32c00d75b89e534e78e7fad75dc1ec05acf1089cfc2865ab1d907ea5f364dacd377cbf3e102f3a1ca14ac246a1960a3986334cb5f3de698
7
- data.tar.gz: 8af17107b023e921b9a660126cc368eb43893724b35c7af76afb6461c623e8d80c9d35f5537af9078b51df8d8f84d6a44b361595249e6db514e64c5e24594bd7
6
+ metadata.gz: d2a151b0bdc36e3ff4872c533e3e701cce5a70c9dbf9758b2ee53cf7026317f6dc49e85741a92c61c38cd0128575741e27b7b6995cd5d0fd66289ee883300975
7
+ data.tar.gz: 28c72b896a9cf0b5a7bd49cb1ebb5ef0fe2cb99a349f91f70f02b667ffc8346c1d47e940bac3ec6823240c95935204bb96aedd8d666ae13d01a5017d082a00f7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.25.1
2
+
3
+ * Add compatibility with ddtrace 1.0
4
+ * Fix issue on WAF garbage collection
5
+
1
6
  ## 1.25.0
2
7
 
3
8
  * Switch from old sq_mini_racer to upstream mini_racer
@@ -66,6 +66,7 @@ module Sqreen
66
66
  end
67
67
 
68
68
  def insert_datadog_middleware(builder, *args, &block)
69
+ return unless defined?(Datadog) && defined?(Datadog::Tracing)
69
70
  return unless defined?(Datadog) && Datadog.respond_to?(:configuration) && Datadog.configuration.instrumented_integrations.key?(:sinatra)
70
71
 
71
72
  Datadog.configure do |c|
@@ -182,9 +182,21 @@ module Sqreen
182
182
  end
183
183
 
184
184
  def datadog_span
185
- return unless defined?(Datadog) && (tracer = Datadog.tracer)
185
+ return unless defined?(Datadog)
186
186
 
187
- tracer.active_span
187
+ if defined?(Datadog::Tracing) && Datadog::Tracing.respond_to?(:active_span)
188
+ Datadog::Tracing.active_span
189
+ elsif Datadog.respond_to?(:tracer) && Datadog.tracer
190
+ Datadog.tracer.active_span
191
+ end
192
+ end
193
+
194
+ def datadog_trace
195
+ return unless defined?(Datadog)
196
+
197
+ if defined?(Datadog::Tracing) && Datadog::Tracing.respond_to?(:active_trace)
198
+ Datadog::Tracing.active_trace
199
+ end
188
200
  end
189
201
 
190
202
  def response_infos
@@ -76,7 +76,11 @@ module Sqreen
76
76
  :datadog_trace_id => datadog_span.trace_id,
77
77
  :datadog_span_id => datadog_span.span_id,
78
78
  )
79
- datadog_span.set_tag(Datadog::Ext::ManualTracing::TAG_KEEP, true)
79
+ if (datadog_trace = framework.datadog_trace)
80
+ datadog_trace.keep!
81
+ else
82
+ datadog_span.set_tag(Datadog::Ext::ManualTracing::TAG_KEEP, true)
83
+ end
80
84
  datadog_span.set_tag('sqreen.event', true)
81
85
  end
82
86
  framework.observe(:attacks, payload, payload_tpl)
@@ -126,7 +126,7 @@ module Sqreen
126
126
  lambda do |object_id|
127
127
  return unless WAFCB.libsqreen?
128
128
 
129
- ::LibSqreen::WAF.delete(waf_rule_name)
129
+ ::LibSqreen::WAF.delete(rule_name)
130
130
  Sqreen.log.debug("WAF rule #{rule_name} deleted, from #<#{name}:0x#{object_id.to_s(16).rjust(16, '0')}>")
131
131
  end
132
132
  end
@@ -4,5 +4,5 @@
4
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
5
5
 
6
6
  module Sqreen
7
- VERSION = '1.25.0'.freeze
7
+ VERSION = '1.25.1'.freeze
8
8
  end
@@ -244,8 +244,17 @@ class Sqreen::Weave::Legacy::Instrumentation
244
244
 
245
245
  # shrinkwrap_timer = Sqreen::Graft::Timer.new('weave,shrinkwrap')
246
246
  # shrinkwrap_timer.start
247
- if defined?(Datadog) && Datadog.tracer && (datadog_span = Datadog.tracer.active_root_span)
248
- Sqreen::Weave.logger.debug { "request datadog:true span_id:#{datadog_span.span_id} parent_id:#{datadog_span.parent_id} trace_id:#{datadog_span.trace_id}" }
247
+ if defined?(Datadog)
248
+ if defined?(Datadog::Tracing) && Datadog::Tracing.respond_to?(:active_trace)
249
+ datadog_active_trace = Datadog::Tracing.active_trace
250
+ datadog_span = datadog_active_trace.send(:root_span) if datadog_active_trace
251
+ elsif Datadog.respond_to?(:tracer) && Datadog.tracer
252
+ datadog_span = Datadog.tracer.active_root_span
253
+ end
254
+
255
+ if datadog_span
256
+ Sqreen::Weave.logger.debug { "request datadog:true span_id:#{datadog_span.span_id} parent_id:#{datadog_span.parent_id} trace_id:#{datadog_span.trace_id}" }
257
+ end
249
258
  end
250
259
 
251
260
  request_timer = Sqreen::Graft::Timer.new("request")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.25.0
4
+ version: 1.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sqreen