rollbar 2.22.1 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/pull_request_template.md +34 -0
- data/.github/workflows/ci.yml +104 -0
- data/.rubocop.yml +185 -33
- data/Gemfile +26 -28
- data/README.md +32 -8
- data/data/rollbar.snippet.js +1 -1
- data/docs/configuration.md +8 -0
- data/gemfiles/rails30.gemfile +17 -35
- data/gemfiles/rails31.gemfile +20 -37
- data/gemfiles/rails32.gemfile +13 -31
- data/gemfiles/rails40.gemfile +12 -32
- data/gemfiles/rails41.gemfile +11 -31
- data/gemfiles/rails42.gemfile +12 -32
- data/gemfiles/rails50.gemfile +16 -30
- data/gemfiles/rails51.gemfile +16 -30
- data/gemfiles/rails52.gemfile +10 -19
- data/gemfiles/rails60.gemfile +10 -25
- data/gemfiles/rails61.gemfile +52 -0
- data/gemfiles/rails70.gemfile +52 -0
- data/lib/generators/rollbar/rollbar_generator.rb +18 -14
- data/lib/rails/rollbar_runner.rb +11 -20
- data/lib/rollbar/capistrano.rb +17 -9
- data/lib/rollbar/capistrano3.rb +8 -2
- data/lib/rollbar/capistrano_tasks.rb +44 -8
- data/lib/rollbar/configuration.rb +138 -84
- data/lib/rollbar/delay/girl_friday.rb +3 -7
- data/lib/rollbar/delay/resque.rb +2 -3
- data/lib/rollbar/delay/shoryuken.rb +4 -3
- data/lib/rollbar/delay/sidekiq.rb +5 -5
- data/lib/rollbar/delay/sucker_punch.rb +4 -6
- data/lib/rollbar/delay/thread.rb +17 -2
- data/lib/rollbar/deploy.rb +8 -7
- data/lib/rollbar/encoding/encoder.rb +17 -6
- data/lib/rollbar/encoding.rb +2 -7
- data/lib/rollbar/exception_reporter.rb +17 -8
- data/lib/rollbar/item/backtrace.rb +22 -10
- data/lib/rollbar/item/frame.rb +8 -5
- data/lib/rollbar/item/locals.rb +49 -2
- data/lib/rollbar/item.rb +80 -50
- data/lib/rollbar/json.rb +2 -1
- data/lib/rollbar/language_support.rb +0 -6
- data/lib/rollbar/lazy_store.rb +3 -7
- data/lib/rollbar/logger.rb +2 -0
- data/lib/rollbar/logger_proxy.rb +3 -1
- data/lib/rollbar/middleware/js/json_value.rb +15 -5
- data/lib/rollbar/middleware/js.rb +70 -38
- data/lib/rollbar/middleware/rack/builder.rb +3 -3
- data/lib/rollbar/middleware/rack/test_session.rb +3 -3
- data/lib/rollbar/middleware/rack.rb +4 -4
- data/lib/rollbar/middleware/rails/rollbar.rb +9 -6
- data/lib/rollbar/middleware/rails/show_exceptions.rb +8 -4
- data/lib/rollbar/notifier/trace_with_bindings.rb +13 -3
- data/lib/rollbar/notifier.rb +309 -172
- data/lib/rollbar/plugin.rb +8 -8
- data/lib/rollbar/plugins/active_job.rb +20 -3
- data/lib/rollbar/plugins/delayed_job/plugin.rb +19 -2
- data/lib/rollbar/plugins/error_context.rb +11 -0
- data/lib/rollbar/plugins/goalie.rb +27 -16
- data/lib/rollbar/plugins/rails/controller_methods.rb +18 -14
- data/lib/rollbar/plugins/rails/railtie30.rb +2 -1
- data/lib/rollbar/plugins/rails/railtie32.rb +2 -1
- data/lib/rollbar/plugins/rails/railtie_mixin.rb +2 -2
- data/lib/rollbar/plugins/rails.rb +5 -2
- data/lib/rollbar/plugins/rake.rb +2 -1
- data/lib/rollbar/plugins/sidekiq/plugin.rb +39 -21
- data/lib/rollbar/plugins/sidekiq.rb +1 -1
- data/lib/rollbar/plugins/thread.rb +8 -7
- data/lib/rollbar/plugins/validations.rb +3 -1
- data/lib/rollbar/rake_tasks.rb +1 -2
- data/lib/rollbar/request_data_extractor.rb +53 -19
- data/lib/rollbar/rollbar_test.rb +9 -118
- data/lib/rollbar/scrubbers/params.rb +13 -7
- data/lib/rollbar/scrubbers/url.rb +56 -17
- data/lib/rollbar/scrubbers.rb +2 -6
- data/lib/rollbar/truncation/frames_strategy.rb +1 -1
- data/lib/rollbar/truncation/mixin.rb +1 -1
- data/lib/rollbar/truncation/remove_any_key_strategy.rb +4 -1
- data/lib/rollbar/truncation/remove_extra_strategy.rb +3 -1
- data/lib/rollbar/truncation/strings_strategy.rb +4 -2
- data/lib/rollbar/util/hash.rb +14 -7
- data/lib/rollbar/util/ip_anonymizer.rb +1 -1
- data/lib/rollbar/util.rb +23 -13
- data/lib/rollbar/version.rb +1 -1
- data/lib/rollbar.rb +12 -7
- data/lib/tasks/benchmark.rake +2 -1
- data/rollbar.gemspec +6 -3
- data/spec/support/rollbar_api.rb +67 -0
- metadata +19 -12
- data/.travis.yml +0 -281
- data/lib/rollbar/encoding/legacy_encoder.rb +0 -20
- /data/lib/generators/rollbar/templates/{initializer.rb → initializer.erb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95b3c3bbbb1f542faf2c67fff212c6a4eb7f0c4986c827fa14b8a64f9c98046c
|
4
|
+
data.tar.gz: 101b72445564b0b8f656f9194ff9140d0551bc556b5444bf69ef4f8c8be67d61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f96379fee61b2b5dcef9f4f4c853c7602fba3ab51ec8e5ae8c95d1d034134e268cb2861842c68877b421c081979dec9b509d6b817e72bac26846d294f1b47f0
|
7
|
+
data.tar.gz: 7d0bd5d1c9ce8f0c0c1f49a1be17f99caa43bf8c15daab6b0674b423f5bdefe03cbc091b56657959a4575c0b1e64988e9f8155a1a8046e6724bb89c2e6fb8917
|
@@ -0,0 +1,34 @@
|
|
1
|
+
## Description of the change
|
2
|
+
|
3
|
+
> Please include a summary of the change and which issues are fixed.
|
4
|
+
> Please also include relevant motivation and context.
|
5
|
+
|
6
|
+
## Type of change
|
7
|
+
|
8
|
+
- [ ] Bug fix (non-breaking change that fixes an issue)
|
9
|
+
- [ ] New feature (non-breaking change that adds functionality)
|
10
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
11
|
+
- [ ] Maintenance
|
12
|
+
- [ ] New release
|
13
|
+
|
14
|
+
## Related issues
|
15
|
+
|
16
|
+
> Shortcut stories and GitHub issues (delete irrelevant)
|
17
|
+
|
18
|
+
- Fix [SC-]
|
19
|
+
- Fix #1
|
20
|
+
|
21
|
+
## Checklists
|
22
|
+
|
23
|
+
### Development
|
24
|
+
|
25
|
+
- [ ] Lint rules pass locally
|
26
|
+
- [ ] The code changed/added as part of this pull request has been covered with tests
|
27
|
+
- [ ] All tests related to the changed code pass in development
|
28
|
+
|
29
|
+
### Code review
|
30
|
+
|
31
|
+
- [ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
|
32
|
+
- [ ] "Ready for review" label attached to the PR and reviewers assigned
|
33
|
+
- [ ] Issue from task tracker has a link to this pull request
|
34
|
+
- [ ] Changes have been reviewed by at least one other engineer
|
@@ -0,0 +1,104 @@
|
|
1
|
+
name: Rollbar-gem CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
runs-on: ubuntu-18.04
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby-version: [2.5.3, 2.6.0, 2.6.6, 2.7.2]
|
15
|
+
gemfile:
|
16
|
+
- gemfiles/rails50.gemfile
|
17
|
+
- gemfiles/rails51.gemfile
|
18
|
+
- gemfiles/rails52.gemfile
|
19
|
+
- gemfiles/rails60.gemfile
|
20
|
+
- gemfiles/rails61.gemfile
|
21
|
+
include:
|
22
|
+
- gemfile: gemfiles/rails70.gemfile
|
23
|
+
ruby-version: 3.1.1
|
24
|
+
- gemfile: gemfiles/rails70.gemfile
|
25
|
+
ruby-version: 3.0.3
|
26
|
+
- gemfile: gemfiles/rails61.gemfile
|
27
|
+
ruby-version: 3.0.3
|
28
|
+
- gemfile: gemfiles/rails42.gemfile
|
29
|
+
ruby-version: 2.4.5
|
30
|
+
- gemfile: gemfiles/rails42.gemfile
|
31
|
+
ruby-version: 2.3.8
|
32
|
+
- gemfile: gemfiles/rails42.gemfile
|
33
|
+
ruby-version: 2.2.10
|
34
|
+
- gemfile: gemfiles/rails41.gemfile
|
35
|
+
ruby-version: 2.3.0
|
36
|
+
- gemfile: gemfiles/rails41.gemfile
|
37
|
+
ruby-version: 2.2.10
|
38
|
+
- gemfile: gemfiles/rails41.gemfile
|
39
|
+
ruby-version: 2.1.9
|
40
|
+
- gemfile: gemfiles/rails40.gemfile
|
41
|
+
ruby-version: 2.3.0
|
42
|
+
- gemfile: gemfiles/rails40.gemfile
|
43
|
+
ruby-version: 2.2.10
|
44
|
+
- gemfile: gemfiles/rails40.gemfile
|
45
|
+
ruby-version: 2.1.9
|
46
|
+
- gemfile: gemfiles/rails32.gemfile
|
47
|
+
ruby-version: 2.2.10
|
48
|
+
- gemfile: gemfiles/rails32.gemfile
|
49
|
+
ruby-version: 2.1.9
|
50
|
+
- gemfile: gemfiles/rails31.gemfile
|
51
|
+
ruby-version: 2.0.0
|
52
|
+
- gemfile: gemfiles/rails30.gemfile
|
53
|
+
ruby-version: 2.0.0
|
54
|
+
|
55
|
+
steps:
|
56
|
+
- uses: actions/checkout@v2
|
57
|
+
with:
|
58
|
+
submodules: recursive
|
59
|
+
|
60
|
+
- name: Start Redis
|
61
|
+
uses: supercharge/redis-github-action@1.1.0
|
62
|
+
with:
|
63
|
+
redis-version: 4
|
64
|
+
|
65
|
+
- name: Setup Ruby > 2.0
|
66
|
+
uses: ruby/setup-ruby@v1
|
67
|
+
if: ${{ matrix.ruby-version != '2.0.0' }}
|
68
|
+
with:
|
69
|
+
ruby-version: ${{ matrix.ruby-version }}
|
70
|
+
|
71
|
+
- name: Setup Ruby 2.0.0
|
72
|
+
if: ${{ matrix.ruby-version == '2.0.0' }}
|
73
|
+
timeout-minutes: 15
|
74
|
+
run: |
|
75
|
+
sudo apt-get update -y
|
76
|
+
sudo apt-get install -y libssl1.0-dev
|
77
|
+
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p648.tar.gz
|
78
|
+
tar xvfz ruby-2.0.0-p648.tar.gz
|
79
|
+
cd ruby-2.0.0-p648
|
80
|
+
./configure && make && sudo make install-nodoc
|
81
|
+
|
82
|
+
- name: Ruby 2.0.0, install bundler
|
83
|
+
if: ${{ matrix.ruby-version == '2.0.0' }}
|
84
|
+
run: sudo gem install bundler -v 1.17.3
|
85
|
+
|
86
|
+
- name: Rails 4.2 ensure bundler version
|
87
|
+
if: ${{ matrix.gemfile == 'gemfiles/rails42.gemfile' }}
|
88
|
+
run: |
|
89
|
+
gem uninstall bundler
|
90
|
+
gem install bundler -v '< 2.0.0'
|
91
|
+
|
92
|
+
- name: Bundle Install
|
93
|
+
run: |
|
94
|
+
export BUNDLE_GEMFILE=${{ matrix.gemfile }}
|
95
|
+
bundle config path vendor/bundle
|
96
|
+
bundle config gemfile ${{ matrix.gemfile }}
|
97
|
+
bundle install --jobs 4 --retry 3
|
98
|
+
|
99
|
+
- name: Rspec
|
100
|
+
run: |
|
101
|
+
export BUNDLE_GEMFILE=${{ matrix.gemfile }}
|
102
|
+
bundle config path vendor/bundle
|
103
|
+
bundle config gemfile ${{ matrix.gemfile }}
|
104
|
+
bundle exec rspec
|
data/.rubocop.yml
CHANGED
@@ -1,42 +1,76 @@
|
|
1
|
+
require: rubocop-performance
|
2
|
+
|
1
3
|
AllCops:
|
2
4
|
Exclude:
|
3
5
|
- 'vendor/**/*'
|
4
6
|
- 'gemfiles/vendor/**/*'
|
7
|
+
- 'spec/dummyapp/**/*'
|
8
|
+
- 'spec/tmp/**/*'
|
9
|
+
TargetRubyVersion: 2.5 # This is the minimum allowed for current rubocop
|
5
10
|
|
6
|
-
|
7
|
-
|
8
|
-
SupportedStyles:
|
9
|
-
- hash_rockets
|
11
|
+
Gemspec/RequiredRubyVersion:
|
12
|
+
Enabled: false # rubocop compares to gemspec, yet won't allow 1.9 as minimum version
|
10
13
|
|
11
|
-
|
12
|
-
|
14
|
+
Layout/HeredocIndentation:
|
15
|
+
# When enabled, forces either squiggly syntax (not available until 2.3),
|
16
|
+
# or external packages that we don't want as dependencies.
|
17
|
+
Enabled: false
|
13
18
|
|
14
|
-
|
15
|
-
Max:
|
19
|
+
Layout/LineLength:
|
20
|
+
Max: 90
|
21
|
+
|
22
|
+
Lint/SendWithMixinArgument:
|
23
|
+
# Object#include is still a private method in Ruby 2.0.
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
Metrics/BlockLength:
|
27
|
+
ExcludedMethods: ['describe', 'context'] # RSpec DSL is expected to have long blocks.
|
16
28
|
|
17
29
|
Metrics/MethodLength:
|
18
30
|
Max: 15 # Relax slightly from the default of 10
|
19
31
|
|
20
|
-
|
32
|
+
Naming/MethodParameterName:
|
33
|
+
# It's possible to configure this cop to allow just about anything, but what's the point.
|
34
|
+
# The default min length of a param name is 3, but the the default whitelist includes things
|
35
|
+
# like `db` and `io`. So, short names really can be useful.
|
21
36
|
Enabled: false
|
22
37
|
|
23
|
-
Style/
|
38
|
+
Style/CaseEquality:
|
39
|
+
# The code uses `===` a lot to compare a regex to a string, but it's not clear that
|
40
|
+
# switching to `=~` is always safe, because in some cases the value could be a regex
|
41
|
+
# or a string and `str1 =~ str2` isn't valid. Whoever enables this cop should carefully
|
42
|
+
# review and test each of these.
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Style/Documentation:
|
46
|
+
# We can enabled this if/when we want to start doing consistent class documentation.
|
47
|
+
# As is, we currently add :nodoc: if anything at all.
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
Style/DoubleNegation:
|
24
51
|
Enabled: false
|
25
52
|
|
26
53
|
Style/EachWithObject:
|
27
54
|
Enabled: false
|
28
55
|
|
29
|
-
|
30
|
-
|
56
|
+
Style/Encoding:
|
57
|
+
Enabled: false # Ruby 1.9.3 needs these magic comments, e.g. # encoding: UTF-8
|
31
58
|
|
32
59
|
Style/ExpandPathArguments:
|
33
60
|
Enabled: false # syntax requires Ruby >= 2.0
|
34
61
|
|
35
|
-
|
36
|
-
|
62
|
+
Style/FrozenStringLiteralComment:
|
63
|
+
# If we do this, it will be in its own PR. It requires adding these magic comments
|
64
|
+
# throughout the project, in order to prepare for a future Ruby 3.x.
|
65
|
+
Enabled: false
|
37
66
|
|
38
|
-
Style/
|
39
|
-
|
67
|
+
Style/HashSyntax:
|
68
|
+
EnforcedStyle: hash_rockets
|
69
|
+
SupportedStyles:
|
70
|
+
- hash_rockets
|
71
|
+
|
72
|
+
Style/Lambda:
|
73
|
+
Enabled: false
|
40
74
|
|
41
75
|
Style/PercentLiteralDelimiters:
|
42
76
|
PreferredDelimiters:
|
@@ -44,25 +78,143 @@ Style/PercentLiteralDelimiters:
|
|
44
78
|
# Make sure we are consistent across all bundles/builds.
|
45
79
|
default: '[]'
|
46
80
|
|
47
|
-
Style/
|
48
|
-
#
|
49
|
-
# As is, we currently add :nodoc: if anything at all.
|
81
|
+
Style/RedundantBegin:
|
82
|
+
# Ruby < 2.5 needs begin/end inside blocks when using rescue
|
50
83
|
Enabled: false
|
51
84
|
|
52
|
-
|
53
|
-
#
|
54
|
-
# The default min length of a param name is 3, but the the default whitelist includes things
|
55
|
-
# like `db` and `io`. So, short names really can be useful.
|
85
|
+
Style/SafeNavigation:
|
86
|
+
# Not available in Ruby < 2.3.
|
56
87
|
Enabled: false
|
57
88
|
|
58
|
-
Style/
|
59
|
-
|
60
|
-
# switching to `=~` is always safe, because in some cases the value could be a regex
|
61
|
-
# or a string and `str1 =~ str2` isn't valid. Whoever enables this cop should carefully
|
62
|
-
# review and test each of these.
|
63
|
-
Enabled: false
|
89
|
+
Style/SymbolArray:
|
90
|
+
Enabled: false # %i[] syntax isn't 1.9.x compatible
|
64
91
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
92
|
+
#
|
93
|
+
# Performance cops are opt in, and `Enabled: true` is always required.
|
94
|
+
# Full list is here: https://github.com/rubocop-hq/rubocop-performance/tree/master/lib/rubocop/cop/performance
|
95
|
+
# For travis builds, Codacy will see and use these directives.
|
96
|
+
#
|
97
|
+
Performance/Caller:
|
98
|
+
Enabled: true
|
99
|
+
Exclude:
|
100
|
+
- spec/**/*
|
101
|
+
|
102
|
+
Performance/CaseWhenSplat:
|
103
|
+
Enabled: true
|
104
|
+
Exclude:
|
105
|
+
- spec/**/*
|
106
|
+
|
107
|
+
Performance/Casecmp:
|
108
|
+
Enabled: true
|
109
|
+
Exclude:
|
110
|
+
- spec/**/*
|
111
|
+
|
112
|
+
Performance/ChainArrayAllocation:
|
113
|
+
Enabled: true
|
114
|
+
Exclude:
|
115
|
+
- spec/**/*
|
116
|
+
|
117
|
+
Performance/CompareWithBlock:
|
118
|
+
Enabled: true
|
119
|
+
Exclude:
|
120
|
+
- spec/**/*
|
121
|
+
|
122
|
+
Performance/Count:
|
123
|
+
Enabled: true
|
124
|
+
Exclude:
|
125
|
+
- spec/**/*
|
126
|
+
|
127
|
+
Performance/Detect:
|
128
|
+
Enabled: true
|
129
|
+
Exclude:
|
130
|
+
- spec/**/*
|
131
|
+
|
132
|
+
Performance/DoubleStartEndWith:
|
133
|
+
Enabled: true
|
134
|
+
Exclude:
|
135
|
+
- spec/**/*
|
136
|
+
|
137
|
+
Performance/EndWith:
|
138
|
+
Enabled: true
|
139
|
+
Exclude:
|
140
|
+
- spec/**/*
|
141
|
+
|
142
|
+
Performance/FixedSize:
|
143
|
+
Enabled: true
|
144
|
+
Exclude:
|
145
|
+
- spec/**/*
|
146
|
+
|
147
|
+
Performance/FlatMap:
|
148
|
+
Enabled: true
|
149
|
+
Exclude:
|
150
|
+
- spec/**/*
|
151
|
+
|
152
|
+
Performance/InefficientHashSearch:
|
153
|
+
Enabled: true
|
154
|
+
Exclude:
|
155
|
+
- spec/**/*
|
156
|
+
|
157
|
+
Performance/OpenStruct:
|
158
|
+
Enabled: true
|
159
|
+
Exclude:
|
160
|
+
- spec/**/*
|
161
|
+
|
162
|
+
Performance/RangeInclude:
|
163
|
+
Enabled: true
|
164
|
+
Exclude:
|
165
|
+
- spec/**/*
|
166
|
+
|
167
|
+
Performance/RedundantBlockCall:
|
168
|
+
Enabled: true
|
169
|
+
Exclude:
|
170
|
+
- spec/**/*
|
171
|
+
|
172
|
+
Performance/RedundantMatch:
|
173
|
+
Enabled: true
|
174
|
+
Exclude:
|
175
|
+
- spec/**/*
|
176
|
+
|
177
|
+
Performance/RedundantMerge:
|
178
|
+
Enabled: true
|
179
|
+
Exclude:
|
180
|
+
- spec/**/*
|
181
|
+
|
182
|
+
Performance/RegexpMatch:
|
183
|
+
Enabled: true
|
184
|
+
Exclude:
|
185
|
+
- spec/**/*
|
186
|
+
|
187
|
+
Performance/ReverseEach:
|
188
|
+
Enabled: true
|
189
|
+
Exclude:
|
190
|
+
- spec/**/*
|
191
|
+
|
192
|
+
Performance/Size:
|
193
|
+
Enabled: true
|
194
|
+
Exclude:
|
195
|
+
- spec/**/*
|
196
|
+
|
197
|
+
Performance/StartWith:
|
198
|
+
Enabled: true
|
199
|
+
Exclude:
|
200
|
+
- spec/**/*
|
201
|
+
|
202
|
+
Performance/StringReplacement:
|
203
|
+
Enabled: true
|
204
|
+
Exclude:
|
205
|
+
- spec/**/*
|
206
|
+
|
207
|
+
Performance/TimesMap:
|
208
|
+
Enabled: true
|
209
|
+
Exclude:
|
210
|
+
- spec/**/*
|
211
|
+
|
212
|
+
Performance/UnfreezeString:
|
213
|
+
Enabled: true
|
214
|
+
Exclude:
|
215
|
+
- spec/**/*
|
216
|
+
|
217
|
+
Performance/UriDefaultParser:
|
218
|
+
Enabled: true
|
219
|
+
Exclude:
|
220
|
+
- spec/**/*
|
data/Gemfile
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
# This
|
1
|
+
# This Gemfile is compatible with Ruby 2.5.0 or greater. To test with
|
2
|
+
# earlier Rubies, use the appropriate Gemfile from the ./gemfiles/ dir.
|
3
|
+
ruby '>= 2.5.0'
|
2
4
|
|
3
5
|
source 'https://rubygems.org'
|
4
6
|
|
@@ -11,8 +13,7 @@ ENV['CURRENT_GEMFILE'] ||= __FILE__
|
|
11
13
|
|
12
14
|
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
|
13
15
|
|
14
|
-
GEMFILE_RAILS_VERSION = '
|
15
|
-
|
16
|
+
GEMFILE_RAILS_VERSION = '~> 6.1.5'.freeze
|
16
17
|
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
17
18
|
gem 'appraisal'
|
18
19
|
gem 'jruby-openssl', :platform => :jruby
|
@@ -21,40 +22,28 @@ gem 'rake'
|
|
21
22
|
if GEMFILE_RAILS_VERSION < '6.0'
|
22
23
|
gem 'rspec-rails', '~> 3.4'
|
23
24
|
else
|
24
|
-
|
25
|
-
gem 'rspec-rails', :git => 'https://github.com/rspec/rspec-rails', :ref => 'v4.0.0.beta2' # rubocop:disable Bundler/DuplicatedGem
|
25
|
+
gem 'rspec-rails', '~> 4.0.2'
|
26
26
|
end
|
27
27
|
|
28
28
|
if GEMFILE_RAILS_VERSION < '6.0'
|
29
29
|
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
|
30
30
|
else
|
31
|
-
gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
|
31
|
+
gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
gem 'sidekiq', '~> 2.13.0'
|
36
|
-
else
|
37
|
-
gem 'sidekiq', '>= 2.13.0' # rubocop:disable Bundler/DuplicatedGem
|
38
|
-
end
|
34
|
+
gem 'sidekiq', '>= 6.4.0'
|
39
35
|
|
40
36
|
platforms :rbx do
|
41
37
|
gem 'minitest'
|
42
38
|
gem 'racc'
|
43
39
|
gem 'rubinius-developer_tools'
|
44
|
-
gem 'rubysl', '~> 2.0'
|
40
|
+
gem 'rubysl', '~> 2.0' if RUBY_VERSION.start_with?('2')
|
45
41
|
end
|
46
42
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
elsif RUBY_VERSION.start_with?('2')
|
52
|
-
gem 'capistrano', :require => false # rubocop:disable Bundler/DuplicatedGem
|
53
|
-
gem 'codacy-coverage'
|
54
|
-
gem 'shoryuken' # rubocop:disable Bundler/DuplicatedGem
|
55
|
-
gem 'simplecov'
|
56
|
-
gem 'sucker_punch', '~> 2.0' # rubocop:disable Bundler/DuplicatedGem
|
57
|
-
end
|
43
|
+
gem 'capistrano', :require => false
|
44
|
+
gem 'shoryuken'
|
45
|
+
gem 'simplecov'
|
46
|
+
gem 'sucker_punch', '~> 2.0'
|
58
47
|
|
59
48
|
unless is_jruby
|
60
49
|
# JRuby doesn't support fork, which is required for this test helper.
|
@@ -62,17 +51,26 @@ unless is_jruby
|
|
62
51
|
end
|
63
52
|
|
64
53
|
gem 'aws-sdk-sqs'
|
65
|
-
|
54
|
+
|
55
|
+
if GEMFILE_RAILS_VERSION >= '5.2'
|
56
|
+
gem 'database_cleaner'
|
57
|
+
elsif GEMFILE_RAILS_VERSION.between?('5.0', '5.2')
|
58
|
+
gem 'database_cleaner', '~> 1.8.4'
|
59
|
+
elsif GEMFILE_RAILS_VERSION < '5.0'
|
60
|
+
gem 'database_cleaner', '~> 1.0.0'
|
61
|
+
end
|
62
|
+
|
66
63
|
if GEMFILE_RAILS_VERSION < '6.0'
|
67
64
|
gem 'delayed_job', :require => false
|
68
65
|
else
|
69
|
-
gem 'delayed_job', '~> 4.1', :require => false
|
66
|
+
gem 'delayed_job', '~> 4.1', :require => false
|
70
67
|
end
|
71
68
|
gem 'generator_spec'
|
72
|
-
gem '
|
73
|
-
gem 'redis'
|
69
|
+
gem 'redis', '<= 4.8.0'
|
74
70
|
gem 'resque', '< 2.0.0'
|
75
|
-
gem 'rubocop', :require => false
|
71
|
+
gem 'rubocop', '1.15.0', :require => false # pin specific version, update manually
|
72
|
+
gem 'rubocop-performance', :require => false
|
73
|
+
gem 'secure_headers', '~> 6.3.2', :require => false
|
76
74
|
gem 'sinatra'
|
77
75
|
gem 'webmock', :require => false
|
78
76
|
gemspec
|
data/README.md
CHANGED
@@ -1,21 +1,35 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=rollbar&package-manager=bundler&version-scheme=semver&target-version=latest)](https://dependabot.com/compatibility-score.html?dependency-name=rollbar&package-manager=bundler&version-scheme=semver&new-version=latest)
|
1
|
+
<p align="center">
|
2
|
+
<img alt="rollbar-logo" src="https://user-images.githubusercontent.com/3300063/207964480-54eda665-d6fe-4527-ba51-b0ab3f41f10b.png" />
|
3
|
+
</p>
|
5
4
|
|
5
|
+
<h1 align="center">Rollbar Ruby Gem</h1>
|
6
6
|
|
7
|
-
>
|
8
|
-
|
7
|
+
<p align="center">
|
8
|
+
<strong>Proactively discover, predict, and resolve errors in real-time with <a href="https://rollbar.com">Rollbar’s</a> error monitoring platform. <a href="https://rollbar.com/signup/">Start tracking errors today</a>!</strong>
|
9
|
+
</p>
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
|
12
|
+
![Build Status](https://github.com/rollbar/rollbar-gem/workflows/Rollbar-gem%20CI/badge.svg?tag=latest)
|
13
|
+
[![Gem Version](https://badge.fury.io/rb/rollbar.svg)](http://badge.fury.io/rb/rollbar)
|
14
|
+
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=rollbar&package-manager=bundler&version-scheme=semver&target-version=latest)](https://dependabot.com/compatibility-score.html?dependency-name=rollbar&package-manager=bundler&version-scheme=semver&new-version=latest)
|
12
15
|
|
13
16
|
|
17
|
+
---
|
14
18
|
|
15
19
|
[Rollbar](https://rollbar.com) is a real-time exception reporting service for Ruby and other languages. The Rollbar service will alert you of problems with your code and help you understand them in a ways never possible before. We love it and we hope you will too.
|
16
20
|
|
17
21
|
Rollbar-gem is the SDK for Ruby apps and includes support for apps using Rails, Sinatra, Rack, plain Ruby, and other frameworks.
|
18
22
|
|
23
|
+
|
24
|
+
## Key benefits of using Rollbar Ruby Gem are:
|
25
|
+
|
26
|
+
- **Frameworks:** Rollbar Ruby Gem supports popular Ruby frameworks such as <a href="https://docs.rollbar.com/docs/rails">Rails</a>, <a href="https://docs.rollbar.com/docs/sinatra">Sinatra</a>, <a href="https://docs.rollbar.com/docs/grape">Grape</a> and more.
|
27
|
+
- **Integrations:** Rollbar Ruby has integrations for <a href="https://docs.rollbar.com/docs/resque-integration">Resque</a>, <a href="https://docs.rollbar.com/docs/activejob-integration">ActiveJob</a>, <a href="https://docs.rollbar.com/docs/using-with-rollbar-agent">rollbar-agent</a>, <a href="https://docs.rollbar.com/docs/sidekiq-integration">Sidekiq</a> and more!
|
28
|
+
- **Automatic error grouping:** Rollbar aggregates Occurrences caused by the same error into Items that represent application issues. <a href="https://docs.rollbar.com/docs/grouping-occurrences">Learn more about reducing log noise</a>.
|
29
|
+
- **Advanced search:** Filter items by many different properties. <a href="https://docs.rollbar.com/docs/search-items">Learn more about search</a>.
|
30
|
+
- **Customizable notifications:** Rollbar supports several messaging and incident management tools where your team can get notified about errors and important events by real-time alerts. <a href="https://docs.rollbar.com/docs/notifications">Learn more about Rollbar notifications</a>.
|
31
|
+
|
32
|
+
|
19
33
|
## Setup Instructions
|
20
34
|
|
21
35
|
1. [Sign up for a Rollbar account](https://rollbar.com/signup)
|
@@ -27,10 +41,20 @@ For complete usage instructions and configuration reference, see our [Ruby SDK d
|
|
27
41
|
|
28
42
|
## Compatibility
|
29
43
|
|
44
|
+
Version >= 3.0.0 is compatible with Ruby >= 2.0.0.
|
45
|
+
|
30
46
|
Version >= 2.19.0 is compatible with Ruby >= 1.9.3.
|
31
47
|
|
32
48
|
Version < 2.19.0 is compatible with Ruby >= 1.8.7.
|
33
49
|
|
50
|
+
### Ruby 2.6.0
|
51
|
+
|
52
|
+
> WARNING: Ruby 2.6.0 introduced a new bug ([#15472 -
|
53
|
+
Invalid JSON data being sent from Net::HTTP in some cases with Ruby 2.6.0](https://bugs.ruby-lang.org/issues/15472)) that may result in the Rollbar API returning an error when an exception is reported. (See [rollbar-gem issue #797](https://github.com/rollbar/rollbar-gem/issues/797)).
|
54
|
+
|
55
|
+
> UPDATE: This bug is fixed in Ruby 2.6.1, and rollbar-gem has a safe workaround in version >= 2.19.0.
|
56
|
+
If you need to stay on Ruby 2.6.0 for any reason, make sure you have the latest rollbar-gem.
|
57
|
+
|
34
58
|
## Release History & Changelog
|
35
59
|
|
36
60
|
See our [Releases](https://github.com/rollbar/rollbar-gem/releases) page for a list of all releases, including changes.
|
data/data/rollbar.snippet.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){var n=o(1),t=o(
|
1
|
+
!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.26.1/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2),t=o(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var l=0;function i(r,e){this.options=r,this._rollbarOldOnError=null;var o=l++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var s=o(4),d=function(r,e){return new i(r,e)},c=function(r){return new s(d,r)};function u(r){return a((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}i.prototype.loadFull=function(r,e,o,n,t){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=a((function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,a,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(a=n.args||[],i=0;i<a.length;++i)if("function"==typeof(l=a[i])){l(e);break}}"function"==typeof t&&t(e)}()}})),d.insertBefore(i,s)},i.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<p.length;++f)i.prototype[p[f]]=u(p[f]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var l=new c(e);return a((function(){e.captureUncaught&&(l._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,l,!0),e.wrapGlobalEventHandlers&&t(r,l,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,l,!0);var a=e.autoInstrument;return!1!==e.enabled&&(void 0===a||!0===a||function(r){return!("object"!=typeof r||void 0!==r.page&&!r.page)}(a))&&r.addEventListener&&(r.addEventListener("load",l.captureLoad.bind(l)),r.addEventListener("DOMContentLoaded",l.captureDomContentLoaded.bind(l))),r[o]=l,l}))()}},Rollbar:c}},function(r,e,o){"use strict";function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var t;if("function"==typeof e._rollbarOldOnError)t=e._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;e._rollbarOldOnError=t}e.handleAnonymousErrors();var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}}}},function(r,e,o){"use strict";function n(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports=function(r,e,o){if(r){var t,a,l="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(t=0;t<l.length;++t)r[a=l[t]]&&r[a].prototype&&n(e,r[a].prototype,o)}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
|
data/docs/configuration.md
CHANGED
@@ -108,6 +108,13 @@ Rollbar notifier.
|
|
108
108
|
|
109
109
|
The number of job failures before reporting the failure to Rollbar.
|
110
110
|
|
111
|
+
### async_skip_report_handler
|
112
|
+
|
113
|
+
**Default** `nil`
|
114
|
+
**Example** `-> (job) { job.cron? }`
|
115
|
+
|
116
|
+
A handler, should respond to `#call`, receives the job and returns a boolean. If true, reporting errors will be skipped. If provided, dj_threshold isn't checked.
|
117
|
+
|
111
118
|
### enabled
|
112
119
|
|
113
120
|
**Default** `true`
|
@@ -129,6 +136,7 @@ An array of backup handlers if the async handlers fails. Each should respond to
|
|
129
136
|
|
130
137
|
For use with `write_to_file`. Indicates location of the rollbar log file being
|
131
138
|
tracked by [rollbar-agent](https://github.com/rollbar/rollbar-agent).
|
139
|
+
Enable `files_with_pid_name_enabled` if you want to have different files for each process(only works if extension `rollbar`)
|
132
140
|
|
133
141
|
### framework
|
134
142
|
|