sidekiq-logstash 2.0.3 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/.rubocop.yml +1 -1
- data/Gemfile +0 -3
- data/README.md +4 -0
- data/lib/sidekiq/logging/shared.rb +1 -1
- data/lib/sidekiq/logstash/configuration.rb +1 -1
- data/lib/sidekiq/logstash/version.rb +1 -1
- data/lib/sidekiq/logstash.rb +9 -12
- data/sidekiq-logstash.gemspec +2 -2
- metadata +7 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de10e32b59ccde04045df621855e1257e4290003c08686be06ac2691ff3eadce
|
4
|
+
data.tar.gz: 2ae07b48658b5f72bef3fa621eef3f57eac826fbd976dcadd3ec2df6e4c74549
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85183e59824a52c5f8394ba5d45e0ca7a8df48dc6b1f668c2c0e880102713a3f7678e19f141172a78909bf030186210d644101b93684edf2f513ef31dceee3e0
|
7
|
+
data.tar.gz: a56567d1a6715345e11bc5292188bf20a7c3db4b11f433071def26f9a39e95a366e14ffbceaf537f56021211c0dc2607fc275b6bcf0a46da5fdef2a6154449ae
|
data/.github/workflows/ci.yml
CHANGED
@@ -19,7 +19,7 @@ jobs:
|
|
19
19
|
- uses: ruby/setup-ruby@v1
|
20
20
|
with:
|
21
21
|
ruby-version: 2.7
|
22
|
-
bundler-cache: true
|
22
|
+
bundler-cache: true
|
23
23
|
- name: Run rubocop
|
24
24
|
run: bundle exec rubocop --format progress
|
25
25
|
build:
|
@@ -27,7 +27,7 @@ jobs:
|
|
27
27
|
runs-on: ubuntu-latest
|
28
28
|
strategy:
|
29
29
|
matrix:
|
30
|
-
ruby: ['2.
|
30
|
+
ruby: ['2.7', '3.0', '3.1']
|
31
31
|
|
32
32
|
steps:
|
33
33
|
- uses: actions/checkout@v2
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -78,6 +78,10 @@ Sidekiq::Logstash.configure do |config|
|
|
78
78
|
config.custom_options = lambda do |payload|
|
79
79
|
payload['my_custom_field'] = 'my_custom_value'
|
80
80
|
end
|
81
|
+
|
82
|
+
# by default, sidekiq-logstash removes the default error handler
|
83
|
+
# to keep it, simply set this to true
|
84
|
+
config.keep_default_error_handler = true
|
81
85
|
end
|
82
86
|
```
|
83
87
|
|
@@ -130,7 +130,7 @@ module Sidekiq
|
|
130
130
|
def deep_stringify!(args)
|
131
131
|
case args
|
132
132
|
when Hash
|
133
|
-
args.
|
133
|
+
args.to_h { |key, value| [deep_stringify!(key), deep_stringify!(value)] }
|
134
134
|
when Array
|
135
135
|
args.map! { |val| deep_stringify!(val) }
|
136
136
|
else
|
@@ -4,7 +4,7 @@ module Sidekiq
|
|
4
4
|
module Logstash
|
5
5
|
# Class that allows to configure the gem behaviour.
|
6
6
|
class Configuration
|
7
|
-
attr_accessor :custom_options, :filter_args, :job_start_log
|
7
|
+
attr_accessor :custom_options, :filter_args, :job_start_log, :keep_default_error_handler
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
@filter_args = []
|
data/lib/sidekiq/logstash.rb
CHANGED
@@ -22,21 +22,18 @@ module Sidekiq
|
|
22
22
|
def self.setup(_opts = {})
|
23
23
|
# Calls Sidekiq.configure_server to inject logics
|
24
24
|
Sidekiq.configure_server do |config|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
config.error_handlers.
|
25
|
+
# Remove default, noisy error handler,
|
26
|
+
# unless LogStash.configuration.keep_default_error_handler is set to true
|
27
|
+
unless configuration.keep_default_error_handler
|
28
|
+
config.error_handlers.delete(Sidekiq::Config::ERROR_HANDLER)
|
29
|
+
# Insert a no-op error handler to prevent Sidekiq from logging to STDOUT
|
30
|
+
# because of empty error_handlers (see link).
|
31
|
+
# https://github.com/mperham/sidekiq/blob/02153c17360e712d9a94c08406fe7c057c4d7635/lib/sidekiq/config.rb#L258
|
32
|
+
config.error_handlers << proc {}
|
29
33
|
end
|
30
34
|
|
31
35
|
# Add logstash support
|
32
|
-
|
33
|
-
# Only available from Sidekiq 6.5
|
34
|
-
config[:job_logger] = Sidekiq::LogstashJobLogger
|
35
|
-
else
|
36
|
-
# This is deprecated and will be removed in Sidekiq 7.0
|
37
|
-
config.options[:job_logger] = Sidekiq::LogstashJobLogger
|
38
|
-
end
|
39
|
-
|
36
|
+
config[:job_logger] = Sidekiq::LogstashJobLogger
|
40
37
|
# Set custom formatter for Sidekiq logger
|
41
38
|
config.logger.formatter = Sidekiq::Logging::LogstashFormatter.new
|
42
39
|
end
|
data/sidekiq-logstash.gemspec
CHANGED
@@ -19,10 +19,10 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
21
|
spec.require_paths = ['lib']
|
22
|
-
spec.required_ruby_version = '>= 2.
|
22
|
+
spec.required_ruby_version = '>= 2.7.0'
|
23
23
|
|
24
24
|
spec.add_dependency 'logstash-event', '~> 1.2'
|
25
|
-
spec.
|
25
|
+
spec.add_dependency 'sidekiq', '~> 7.0'
|
26
26
|
|
27
27
|
spec.add_development_dependency 'factory_bot', '~> 6.1'
|
28
28
|
spec.add_development_dependency 'rake', '>= 10'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-logstash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattia Giuffrida
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-event
|
@@ -28,22 +28,16 @@ dependencies:
|
|
28
28
|
name: sidekiq
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '6.0'
|
34
|
-
- - "<"
|
31
|
+
- - "~>"
|
35
32
|
- !ruby/object:Gem::Version
|
36
|
-
version: '7'
|
33
|
+
version: '7.0'
|
37
34
|
type: :runtime
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
|
-
- - "
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '6.0'
|
44
|
-
- - "<"
|
38
|
+
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: '7'
|
40
|
+
version: '7.0'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: factory_bot
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
157
151
|
requirements:
|
158
152
|
- - ">="
|
159
153
|
- !ruby/object:Gem::Version
|
160
|
-
version: 2.
|
154
|
+
version: 2.7.0
|
161
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
156
|
requirements:
|
163
157
|
- - ">="
|