sentry-ruby-core 4.1.5 → 4.1.6

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: c7862b3ddbb49c77b2c47c1a9509cce1efa4c193d459d0b3bd07bebd6aa9b62e
4
- data.tar.gz: faca1cc6efce70d3f64e1266c2e32fc2d67352544f8bfc2b2a278bcbefca1a61
3
+ metadata.gz: 584f6d4758f8c7756443aa2f242e0c8c8d8f34b49089863714ae52b76b18c4af
4
+ data.tar.gz: 4a0c8fc92d430a1b8b0726d2cee9c96d4ddc918f99702081c93b5af9b75a53a3
5
5
  SHA512:
6
- metadata.gz: 76dbfe0e360744126dcfdfce35d1563fb14387bafb1196c315fd1ef5e9d57c09d4d627f5a5386610a031a4909fab28a659bdfcd66e96d00a2e56c8737c130358
7
- data.tar.gz: e4c26db4e8bcaa1c6a32c4acadc9d385356b3617b8d5e76ffeda773b9deb4da291a77eafef27aa7bb98539cca187f27d174a7d0cc16c1ef8204c380e46fd54fc
6
+ metadata.gz: d1ebaf29b9c6712e7f23ef91cad67e0ddb50fcd2849b45e1fba31e7e7e58acdacbf1f64cb6abb50c1269aa4dedf0e8dd1bd5df7cc8ea83a0be223c2124ab2652
7
+ data.tar.gz: 3f2e9ff72da83a8644de0e2ca6cc85b3febaa7a3bd9b84abf10e91047207debfcf83e446ee63216dbfc097947b874cd605ffa89947e162331f33f103b599ae36
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.1.6
4
+
5
+ - Don't detect project root for Rails apps [#1243](https://github.com/getsentry/sentry-ruby/pull/1243)
6
+ - Separate individual breadcrumb's data serialization [#1250](https://github.com/getsentry/sentry-ruby/pull/1250)
7
+ - Capture sentry-trace with the correct http header key [#1260](https://github.com/getsentry/sentry-ruby/pull/1260)
8
+
3
9
  ## 4.1.5
4
10
 
5
11
  - Serialize event hint before passing it to the async block [#1231](https://github.com/getsentry/sentry-ruby/pull/1231)
data/Gemfile CHANGED
@@ -3,6 +3,9 @@ source "https://rubygems.org"
3
3
  gem "sentry-ruby-core", path: "./"
4
4
  gem "sentry-ruby", path: "./"
5
5
 
6
+ # TODO: Remove this if https://github.com/jruby/jruby/issues/6547 is addressed
7
+ gem "i18n", "<= 1.8.7"
8
+
6
9
  gem "rake", "~> 12.0"
7
10
  gem "rspec", "~> 3.0"
8
11
  gem "codecov", "0.2.12"
data/Makefile ADDED
@@ -0,0 +1,4 @@
1
+ build:
2
+ bundle install
3
+ gem build sentry-ruby-core.gemspec
4
+ gem build sentry-ruby.gemspec
@@ -1,5 +1,7 @@
1
1
  module Sentry
2
2
  class Breadcrumb
3
+ DATA_SERIALIZATION_ERROR_MESSAGE = "[data were removed due to serialization issues]"
4
+
3
5
  attr_accessor :category, :data, :message, :level, :timestamp, :type
4
6
 
5
7
  def initialize(category: nil, data: nil, message: nil, timestamp: nil, level: nil, type: nil)
@@ -13,13 +15,30 @@ module Sentry
13
15
 
14
16
  def to_hash
15
17
  {
16
- :category => @category,
17
- :data => @data,
18
- :level => @level,
19
- :message => @message,
20
- :timestamp => @timestamp,
21
- :type => @type
18
+ category: @category,
19
+ data: serialized_data,
20
+ level: @level,
21
+ message: @message,
22
+ timestamp: @timestamp,
23
+ type: @type
22
24
  }
23
25
  end
26
+
27
+ private
28
+
29
+ def serialized_data
30
+ begin
31
+ ::JSON.parse(::JSON.generate(@data))
32
+ rescue Exception => e
33
+ Sentry.logger.debug(LOGGER_PROGNAME) do
34
+ <<~MSG
35
+ can't serialize breadcrumb data because of error: #{e}
36
+ data: #{@data}
37
+ MSG
38
+ end
39
+
40
+ DATA_SERIALIZATION_ERROR_MESSAGE
41
+ end
42
+ end
24
43
  end
25
44
  end
@@ -34,7 +34,7 @@ module Sentry
34
34
 
35
35
  def to_hash
36
36
  {
37
- :values => members.map(&:to_hash)
37
+ values: members.map(&:to_hash)
38
38
  }
39
39
  end
40
40
 
@@ -164,7 +164,7 @@ module Sentry
164
164
  self.inspect_exception_causes_for_exclusion = false
165
165
  self.linecache = ::Sentry::LineCache.new
166
166
  self.logger = ::Sentry::Logger.new(STDOUT)
167
- self.project_root = detect_project_root
167
+ self.project_root = Dir.pwd
168
168
 
169
169
  self.release = detect_release
170
170
  self.sample_rate = 1.0
@@ -267,14 +267,6 @@ module Sentry
267
267
 
268
268
  private
269
269
 
270
- def detect_project_root
271
- if defined? Rails.root # we are in a Rails application
272
- Rails.root.to_s
273
- else
274
- Dir.pwd
275
- end
276
- end
277
-
278
270
  def detect_release
279
271
  detect_release_from_env ||
280
272
  detect_release_from_git ||
@@ -17,7 +17,7 @@ module Sentry
17
17
  scope.set_rack_env(env)
18
18
 
19
19
  span =
20
- if sentry_trace = env["sentry-trace"]
20
+ if sentry_trace = env["HTTP_SENTRY_TRACE"]
21
21
  Sentry::Transaction.from_sentry_trace(sentry_trace, name: scope.transaction_name, op: transaction_op)
22
22
  else
23
23
  Sentry.start_transaction(name: scope.transaction_name, op: transaction_op)
@@ -1,3 +1,3 @@
1
1
  module Sentry
2
- VERSION = "4.1.5"
2
+ VERSION = "4.1.6"
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.1.5
4
+ version: 4.1.6
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-01-27 00:00:00.000000000 Z
11
+ date: 2021-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -53,6 +53,7 @@ files:
53
53
  - CODE_OF_CONDUCT.md
54
54
  - Gemfile
55
55
  - LICENSE.txt
56
+ - Makefile
56
57
  - README.md
57
58
  - Rakefile
58
59
  - bin/console