sentry-ruby-core 4.2.0 → 4.2.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: f228cdc7c08c8c6de173c997a1e21b28008026280c9d4680b786be20c9d8590e
4
- data.tar.gz: 871d6e1ba2c6799e18ee4c2c89ce0807ebc79a6018e074f5007e955fc2a5dd78
3
+ metadata.gz: b378de66aa7efcec9e63c6542a398a0f6a9a556081dd99f77ab45b1ba8afa298
4
+ data.tar.gz: 7491b05d6b00b24d2160363c0ac345169fb4059e5fc51bfeeb9038ea91c30a3b
5
5
  SHA512:
6
- metadata.gz: 4155d1944e86ed17387643ce2325f0fae3c2ea8a9dfd9a020b4bb68e36390b5ef3b5fd74c2b79e68847bc5f7c636e59310d57d8819eaf0a62059e8663358821c
7
- data.tar.gz: 7d09d5d45d2eb284fc9539d956db09dcf38a42546ccdf1e047872ec7eafdfa052656b13d4ea2cdc523dd1ff069a749f1f3963ab76398587378f2020f995e0c7c
6
+ metadata.gz: 6ba47551dc4b3d5315df49e0e53877d92b8c5f9ce547e615e5b098cc0ca9729db8bafd4d6ca39977dcedb09c5066e7f7084aa5e3e3276e33445087f8d614e321
7
+ data.tar.gz: 8b5eca42bad5ea2158c4aa68d93e5e6a3db7675be8da4d44fd5c7bf1f963f587cd06c462a893486a739628d1309f7c39e8418ca8b14de1fe241c8fa59587159e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.2.1
4
+
5
+ ### Bug Fixes
6
+
7
+ - Ignore invalid values for sentry-trace header that don't match the required format [#1265](https://github.com/getsentry/sentry-ruby/pull/1265)
8
+ - Transaction created by `.from_sentry_trace` should inherit sampling decision [#1269](https://github.com/getsentry/sentry-ruby/pull/1269)
9
+ - Transaction's sample rate should accept any numeric value [#1278](https://github.com/getsentry/sentry-ruby/pull/1278)
10
+
3
11
  ## 4.2.0
4
12
 
5
13
  ### Features
@@ -16,12 +16,9 @@ module Sentry
16
16
  scope.set_transaction_name(env["PATH_INFO"]) if env["PATH_INFO"]
17
17
  scope.set_rack_env(env)
18
18
 
19
- span =
20
- if sentry_trace = env["HTTP_SENTRY_TRACE"]
21
- Sentry::Transaction.from_sentry_trace(sentry_trace, name: scope.transaction_name, op: transaction_op)
22
- else
23
- Sentry.start_transaction(name: scope.transaction_name, op: transaction_op)
24
- end
19
+ sentry_trace = env["HTTP_SENTRY_TRACE"]
20
+ span = Sentry::Transaction.from_sentry_trace(sentry_trace, name: scope.transaction_name, op: transaction_op) if sentry_trace
21
+ span ||= Sentry.start_transaction(name: scope.transaction_name, op: transaction_op)
25
22
 
26
23
  scope.set_span(span)
27
24
 
@@ -29,11 +29,12 @@ module Sentry
29
29
  return unless sentry_trace
30
30
 
31
31
  match = SENTRY_TRACE_REGEXP.match(sentry_trace)
32
+ return if match.nil?
32
33
  trace_id, parent_span_id, sampled_flag = match[1..3]
33
34
 
34
35
  sampled = sampled_flag != "0"
35
36
 
36
- new(trace_id: trace_id, parent_span_id: parent_span_id, parent_sampled: sampled, **options)
37
+ new(trace_id: trace_id, parent_span_id: parent_span_id, parent_sampled: sampled, sampled: sampled, **options)
37
38
  end
38
39
 
39
40
  def to_hash
@@ -89,7 +90,7 @@ module Sentry
89
90
  sample_rate = traces_sampler.call(sampling_context)
90
91
  end
91
92
 
92
- unless [true, false].include?(sample_rate) || (sample_rate.is_a?(Float) && sample_rate >= 0.0 && sample_rate <= 1.0)
93
+ unless [true, false].include?(sample_rate) || (sample_rate.is_a?(Numeric) && sample_rate >= 0.0 && sample_rate <= 1.0)
93
94
  @sampled = false
94
95
  logger.warn("#{MESSAGE_PREFIX} Discarding #{transaction_description} because of invalid sample_rate: #{sample_rate}")
95
96
  return
@@ -1,3 +1,3 @@
1
1
  module Sentry
2
- VERSION = "4.2.0"
2
+ VERSION = "4.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-ruby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-04 00:00:00.000000000 Z
11
+ date: 2021-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday