gruf-sentry 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61ef067487d01b1c5f9ea551d5fc26d41237795992c1815863e6f19912b25651
4
- data.tar.gz: 7f49f3b82c3c7bbad48f80a56f6e81f6209495c948aef160d7311e09fa951d10
3
+ metadata.gz: 32298141ac37477b1f749a5c6c942703ec05419aa4dc89ffa7f5c5943a3cc72c
4
+ data.tar.gz: 58b2123089b08e03166349a6217d5766a313d60411ca7885415374aad31b8aa2
5
5
  SHA512:
6
- metadata.gz: f8a51834036eb432920dc6b725b75307980d663da6e98eb3d72c4d543f92cb0b8b6e1a16f9b64bdfedba75996e80885dba815a3b2061aaa73b6f34e5d89860b6
7
- data.tar.gz: b21352a30756226ef13a2a56cded911799633cda6f05c33a547b3b8c4199b8b2a930d0c76ca241f8706ec5c1ff07e11469a541f80a9312ea2d4dc24e8bb978c2
6
+ metadata.gz: 0b11792c9270db40e7a46984b121a33cbfa415f7c090672b8cc07f1b8342415e2591fdf66cafb3855a1ead1f7dc9f7ab493349c9d8e82baabab13b891a0fbc4c
7
+ data.tar.gz: 618e01d599453da55a7dc2789007173af1cf88b76bedbb96eaf9227216221c77de003874d2b35ee777e06f3ccf3b05fb95bd0885141b9fb5557f6c2cb1f85f9b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@ Changelog for the gruf-sentry gem.
2
2
 
3
3
  ### Pending release
4
4
 
5
+ ### 1.2.0
6
+
7
+ - Add Ruby 3.1 support
8
+ - Drop Ruby 2.6 support
9
+
10
+ ### 1.1.0
11
+
12
+ - Update Gruf::Sentry::ClientInterceptor for new sentry-ruby format
13
+
14
+ ### 1.0.1
15
+
16
+ - Update Sentry.capture_exception to work with new sentry-ruby format
17
+
5
18
  ### 1.0.0
6
19
 
7
20
  - Update to sentry-ruby
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # gruf-sentry - Sentry reporting for gruf
2
2
 
3
- [![CircleCI](https://circleci.com/gh/bigcommerce/gruf-sentry/tree/main.svg?style=svg)](https://circleci.com/gh/bigcommerce/gruf-sentry/tree/main) [![Gem Version](https://badge.fury.io/rb/gruf-sentry.svg)](https://badge.fury.io/rb/gruf-sentry) [![Inline docs](http://inch-ci.org/github/bigcommerce/gruf-sentry.svg?branch=main)](http://inch-ci.org/github/bigcommerce/gruf-sentry)
3
+ [![CircleCI](https://circleci.com/gh/bigcommerce/gruf-sentry/tree/main.svg?style=svg)](https://circleci.com/gh/bigcommerce/gruf-sentry/tree/main) [![Gem Version](https://badge.fury.io/rb/gruf-sentry.svg)](https://badge.fury.io/rb/gruf-sentry) [![Inline docs](http://inch-ci.org/github/bigcommerce/gruf-sentry.svg?branch=main)](http://inch-ci.org/github/bigcommerce/gruf-sentry) [![Maintainability](https://api.codeclimate.com/v1/badges/530757a403a4a596dda0/maintainability)](https://codeclimate.com/github/bigcommerce/gruf-sentry/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/530757a403a4a596dda0/test_coverage)](https://codeclimate.com/github/bigcommerce/gruf-sentry/test_coverage)
4
4
 
5
- Adds Sentry error reporting support for [gruf](https://github.com/bigcommerce/gruf) 2.7.0+.
5
+ Adds Sentry error reporting support for [gruf](https://github.com/bigcommerce/gruf) 2.7.0+
6
+ and [sentry-ruby](https://github.com/getsentry/sentry-ruby) 4.3+.
6
7
 
7
8
  This gem will automatically report grpc failures and Gruf errors into Sentry as they happen in servers and clients.
8
9
 
@@ -24,9 +25,11 @@ end
24
25
 
25
26
  It comes with a few more options as well:
26
27
 
27
- | Option | Description | Default |
28
- | ------ | ----------- | ------- |
29
- | ignore_methods | An array of method names to ignore from logging. E.g. `['namespace.health.check']` | `[]` |
28
+ | Option | Description | Default | ENV Key |
29
+ |--------------------|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|----------------------------------|
30
+ | ignore_methods | A list of method names to ignore from logging. E.g. `['namespace.health.check']` | `[]` | GRUF_SENTRY_IGNORE_METHODS |
31
+ | grpc_error_classes | A list of gRPC error classes that will be used for detecting errors (as opposed to validation) | `GRPC::Unknown,GRPC::Internal,GRPC::DataLoss,GRPC::FailedPrecondition,GRPC::Unavailable,GRPC::DeadlineExceeded,GRPC::Cancelled` | GRUF_SENTRY_GRPC_ERROR_CLASSES |
32
+ | default_error_code | The default gRPC error code to use (int value) | `GRPC::Core::StatusCodes::INTERNAL` | `GRUF_SENTRY_DEFAULT_ERROR_CODE` |
30
33
 
31
34
  ### Client Interceptors
32
35
 
@@ -43,17 +46,17 @@ Gruf::Client.new(
43
46
 
44
47
  ## License
45
48
 
46
- Copyright (c) 2020-present, BigCommerce Pty. Ltd. All rights reserved
49
+ Copyright (c) 2020-present, BigCommerce Pty. Ltd. All rights reserved
47
50
 
48
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
49
- documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
50
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
51
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
52
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
53
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
51
54
  persons to whom the Software is furnished to do so, subject to the following conditions:
52
55
 
53
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
56
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
54
57
  Software.
55
58
 
56
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
57
- WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
58
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
59
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
60
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
61
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
59
62
  OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/gruf-sentry.gemspec CHANGED
@@ -30,14 +30,14 @@ Gem::Specification.new do |spec|
30
30
  spec.description = spec.summary
31
31
  spec.homepage = 'https://github.com/bigcommerce/gruf-sentry'
32
32
 
33
- spec.required_ruby_version = '>= 2.6'
33
+ spec.required_ruby_version = '>= 2.7'
34
34
 
35
35
  spec.files = Dir['README.md', 'CHANGELOG.md', 'CODE_OF_CONDUCT.md', 'lib/**/*', 'gruf-sentry.gemspec']
36
36
  spec.require_paths = ['lib']
37
37
 
38
38
  spec.add_development_dependency 'bundler-audit', '~> 0.6'
39
39
  spec.add_development_dependency 'rake', '>= 12.3'
40
- spec.add_development_dependency 'rubocop', '>= 1'
40
+ spec.add_development_dependency 'rubocop', '>= 1.27'
41
41
  spec.add_development_dependency 'pry', '~> 0.14'
42
42
  spec.add_development_dependency 'rspec', '>= 3.8'
43
43
  spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4'
@@ -33,17 +33,15 @@ module Gruf
33
33
  yield
34
34
  rescue StandardError, GRPC::BadStatus => e
35
35
  if error?(e) # only capture
36
- ::Sentry.capture_exception(
37
- e,
38
- message: e.message,
39
- extra: {
40
- grpc_method_name: request_context.method_name,
41
- grpc_route_key: request_context.route_key,
42
- grpc_call_type: request_context.type,
43
- grpc_error_code: code_for(e),
44
- grpc_error_class: e.class
45
- }
46
- )
36
+ ::Sentry.configure_scope do |scope|
37
+ scope.set_transaction_name(request_context.route_key)
38
+ scope.set_tags(grpc_method_name: request_context.method_name,
39
+ grpc_route_key: request_context.route_key,
40
+ grpc_call_type: request_context.type,
41
+ grpc_error_code: code_for(e),
42
+ grpc_error_class: e.class.name)
43
+ end
44
+ ::Sentry.capture_exception(e)
47
45
  end
48
46
  raise # passthrough
49
47
  end
@@ -33,17 +33,15 @@ module Gruf
33
33
  yield
34
34
  rescue StandardError, GRPC::BadStatus => e
35
35
  if error?(e) # only capture
36
- ::Sentry.capture_exception(
37
- e,
38
- message: e.message,
39
- extra: {
40
- grpc_method: request.method_key,
41
- grpc_request_class: request.request_class,
42
- grpc_service_key: request.service_key,
43
- grpc_error_code: code_for(e),
44
- grpc_error_class: e.class
45
- }
46
- )
36
+ ::Sentry.configure_scope do |scope|
37
+ scope.set_transaction_name(request.service_key)
38
+ scope.set_tags(grpc_method: request.method_key,
39
+ grpc_request_class: request.request_class.name,
40
+ grpc_service_key: request.service_key,
41
+ grpc_error_code: code_for(e),
42
+ grpc_error_class: e.class.name)
43
+ end
44
+ ::Sentry.capture_exception(e)
47
45
  end
48
46
  raise # passthrough
49
47
  end
@@ -17,6 +17,6 @@
17
17
  #
18
18
  module Gruf
19
19
  module Sentry
20
- VERSION = '1.0.0'
20
+ VERSION = '1.2.0'
21
21
  end
22
22
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-present, BigCommerce Pty. Ltd. All rights reserved
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
+ # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
7
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
8
+ # persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
11
+ # Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
14
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16
+ # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
+ #
18
+ require_relative 'gruf/sentry'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruf-sentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun McCormick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-03 00:00:00.000000000 Z
11
+ date: 2022-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler-audit
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1'
47
+ version: '1.27'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1'
54
+ version: '1.27'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -153,6 +153,7 @@ files:
153
153
  - CODE_OF_CONDUCT.md
154
154
  - README.md
155
155
  - gruf-sentry.gemspec
156
+ - lib/gruf-sentry.rb
156
157
  - lib/gruf/sentry.rb
157
158
  - lib/gruf/sentry/client_interceptor.rb
158
159
  - lib/gruf/sentry/configuration.rb
@@ -171,14 +172,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
172
  requirements:
172
173
  - - ">="
173
174
  - !ruby/object:Gem::Version
174
- version: '2.6'
175
+ version: '2.7'
175
176
  required_rubygems_version: !ruby/object:Gem::Requirement
176
177
  requirements:
177
178
  - - ">="
178
179
  - !ruby/object:Gem::Version
179
180
  version: '0'
180
181
  requirements: []
181
- rubygems_version: 3.0.9
182
+ rubygems_version: 3.3.4
182
183
  signing_key:
183
184
  specification_version: 4
184
185
  summary: Automatically report gruf failures as sentry errors