fluent-plugin-raven 0.1.4 → 0.1.5

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: c76a4ef14dd2212f285603c6e646de0009f5265890da9f712743bf441a9dc05e
4
- data.tar.gz: 3dde49be38c328de366815d085dd626a0ddaeec0070dbb7fc2e86c46f07b8b4d
3
+ metadata.gz: 6f5873d6e2475752f7672175247470b700a67786e3918b8a8149912e337d82b7
4
+ data.tar.gz: 52139906d914a4f3fc764df0488d6c406c81f07d0f1773f9f7b51cbd9bb2a619
5
5
  SHA512:
6
- metadata.gz: 2935862392b7952d15dc6cbeef5307c8ec6fd412496e1f4beabf2e28947ba597c8ddb8072d46ee60558c1ce66a6dface7dc43aae3477943f95bb820fbbadf402
7
- data.tar.gz: 1de3b106ba871dd36051b8990dfeede9dff0464a565168ba0baf8860d3f943e032178dca6407309eacd382f8f6190933240e4a4c63de192f514ec353c8ae86e8
6
+ metadata.gz: 8c59c5d714d38587639a711ae8b201b4c531121978b7369beaac30b506d5846ef65f48e899ba2511b67cd193a26b2a4a8257fa24e0838c0e5b09ee05c6f5f9f3
7
+ data.tar.gz: d5982130d7fd301a84c1406b7510cf8b94f2a42fae502f7a48cdf6d53c73926c1e62dad26ac4fbd79213135f6ff000f220960eac58a1fc083be9f08ac910e673
@@ -0,0 +1,27 @@
1
+ name: Test
2
+ on:
3
+ - push
4
+ - pull_request
5
+ jobs:
6
+ build:
7
+ runs-on: ${{ matrix.os }}
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby: ["2.5", "2.6", "2.7", "3.0"]
12
+ os:
13
+ - ubuntu-latest
14
+ - windows-latest
15
+ name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ - name: unit testing
22
+ env:
23
+ CI: true
24
+ run: |
25
+ gem install bundler rake
26
+ bundle install --jobs 4 --retry 3
27
+ bundle exec rake test
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/README.md CHANGED
@@ -32,7 +32,7 @@ If `tag` is specified as bufferd chunk key, it send as tag for sentry.
32
32
 
33
33
  ```aconf
34
34
  <match **>
35
- @type sentry
35
+ @type raven
36
36
  dsn https://12345678@sentry.io/123456
37
37
  environment development
38
38
  <buffer tag>
@@ -45,6 +45,13 @@ If `tag` is specified as bufferd chunk key, it send as tag for sentry.
45
45
  </match>
46
46
  ```
47
47
 
48
+ ## Development
49
+
50
+ ```
51
+ bundle install
52
+ bundle exec fluentd -c example/fluentd.conf
53
+ ```
54
+
48
55
  ## Copyright
49
56
 
50
57
  * Copyright(c) 2019- Yuto Suzuki
data/Rakefile CHANGED
@@ -1,11 +1,13 @@
1
- require "bundler"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
4
- require "rake/testtask"
6
+ require 'rake/testtask'
5
7
 
6
8
  Rake::TestTask.new(:test) do |t|
7
- t.libs.push("lib", "test")
8
- t.test_files = FileList["test/**/test_*.rb"]
9
+ t.libs.push('lib', 'test')
10
+ t.test_files = FileList['test/**/test_*.rb']
9
11
  t.verbose = true
10
12
  t.warning = true
11
13
  end
@@ -0,0 +1,16 @@
1
+ <source>
2
+ @type forward
3
+ </source>
4
+
5
+ <match fluent.**>
6
+ @type raven
7
+ @id out_raven
8
+ dsn "#{ENV['SENTRY_DSN']}"
9
+ environment "#{ENV['ENV']}"
10
+ <buffer>
11
+ @type file
12
+ path fluentd/log/error.*.buffer
13
+ flush_at_shutdown true
14
+ flush_interval 1s
15
+ </buffer>
16
+ </match>
@@ -1,16 +1,18 @@
1
- lib = File.expand_path("../lib", __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
 
4
6
  Gem::Specification.new do |spec|
5
- spec.name = "fluent-plugin-raven"
6
- spec.version = "0.1.4"
7
- spec.authors = ["Yuto Suzuki"]
8
- spec.email = ["yuutoo.advance@gmail.com"]
7
+ spec.name = 'fluent-plugin-raven'
8
+ spec.version = '0.1.5'
9
+ spec.authors = ['Yuto Suzuki']
10
+ spec.email = ['yuutoo.advance@gmail.com']
9
11
 
10
- spec.summary = "sentry output plugin for Fluentd"
12
+ spec.summary = 'sentry output plugin for Fluentd'
11
13
  spec.description = spec.summary
12
- spec.homepage = "https://github.com/mocyuto/fluent-plugin-raven"
13
- spec.license = "Apache-2.0"
14
+ spec.homepage = 'https://github.com/mocyuto/fluent-plugin-raven'
15
+ spec.license = 'Apache-2.0'
14
16
 
15
17
  test_files, files = `git ls-files -z`.split("\x0").partition do |f|
16
18
  f.match(%r{^(test|spec|features)/})
@@ -18,11 +20,13 @@ Gem::Specification.new do |spec|
18
20
  spec.files = files
19
21
  spec.executables = files.grep(%r{^bin/}) { |f| File.basename(f) }
20
22
  spec.test_files = test_files
21
- spec.require_paths = ["lib"]
23
+ spec.require_paths = ['lib']
24
+ spec.required_ruby_version = '>= 2.5'
22
25
 
23
- spec.add_development_dependency "bundler", "~> 1.14"
24
- spec.add_development_dependency "rake", "~> 12.0"
25
- spec.add_development_dependency "test-unit", "~> 3.0"
26
- spec.add_runtime_dependency "fluentd", [">= 0.14.10", "< 2"]
27
- spec.add_runtime_dependency "sentry-raven", "> 2"
26
+ spec.add_runtime_dependency 'fluentd', ['>= 0.14.10', '< 2']
27
+ spec.add_runtime_dependency 'sentry-ruby', '< 5'
28
+ spec.add_development_dependency 'bundler'
29
+ spec.add_development_dependency 'rake'
30
+ spec.add_development_dependency 'rubocop-rake'
31
+ spec.add_development_dependency 'test-unit'
28
32
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
4
  # Copyright 2019- Yuto Suzuki
3
5
  #
@@ -13,29 +15,26 @@
13
15
  # See the License for the specific language governing permissions and
14
16
  # limitations under the License.
15
17
 
16
- require "fluent/plugin/output"
17
- require "raven"
18
+ require 'fluent/plugin/output'
19
+ require 'sentry-ruby'
18
20
 
19
21
  module Fluent::Plugin
20
22
  class RavenOutput < Output
21
- Fluent::Plugin.register_output("raven", self)
23
+ Fluent::Plugin.register_output('raven', self)
22
24
 
23
25
  helpers :inject
24
26
 
25
27
  config_param :dsn, :string, default: nil
26
28
  config_param :environment, :string, default: nil
27
- config_param :default_level, :string, :default => 'error'
29
+ config_param :default_level, :string, default: 'error'
28
30
 
29
31
  def configure(conf)
30
32
  super
31
33
 
32
- if dsn == nil
33
- raise Fluent::ConfigError, "Need to Set DSN"
34
- end
34
+ raise Fluent::ConfigError, 'Need to Set DSN' if dsn.nil?
35
35
 
36
- Raven.configure do |config|
36
+ Sentry.init do |config|
37
37
  config.dsn = dsn
38
- config.current_environment = environment
39
38
  end
40
39
  end
41
40
 
@@ -45,16 +44,16 @@ module Fluent::Plugin
45
44
 
46
45
  def write(chunk)
47
46
  tag = chunk.metadata.tag
48
- chunk.each do |time, record|
49
- Raven.capture_message record['message'],
50
- logger: 'fluent-sentry-logger',
51
- level: record['level'] || @default_level,
52
- tags: {
53
- worker: record['worker'],
54
- tag: tag
55
- }
47
+ chunk.each do |_time, record|
48
+ Sentry.capture_message record['message'],
49
+ level: record['level'] || @default_level,
50
+ tags: {
51
+ logger: 'fluent-sentry-logger',
52
+ worker: record['worker'],
53
+ tag: tag,
54
+ environment: environment
55
+ }
56
56
  end
57
57
  end
58
58
  end
59
59
  end
60
-
data/test/helper.rb CHANGED
@@ -1,8 +1,10 @@
1
- $LOAD_PATH.unshift(File.expand_path("../../", __FILE__))
2
- require "test-unit"
3
- require "fluent/test"
4
- require "fluent/test/driver/output"
5
- require "fluent/test/helpers"
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift(File.expand_path('..', __dir__))
4
+ require 'test-unit'
5
+ require 'fluent/test'
6
+ require 'fluent/test/driver/output'
7
+ require 'fluent/test/helpers'
6
8
 
7
9
  Test::Unit::TestCase.include(Fluent::Test::Helpers)
8
10
  Test::Unit::TestCase.extend(Fluent::Test::Helpers)
@@ -1,5 +1,7 @@
1
- require "helper"
2
- require "fluent/plugin/out_raven.rb"
1
+ # frozen_string_literal: true
2
+
3
+ require 'helper'
4
+ require 'fluent/plugin/out_raven'
3
5
 
4
6
  class RavenOutputTest < Test::Unit::TestCase
5
7
  setup do
metadata CHANGED
@@ -1,91 +1,105 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-raven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuto Suzuki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-30 00:00:00.000000000 Z
11
+ date: 2021-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: fluentd
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
20
- type: :development
19
+ version: 0.14.10
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
23
+ type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.14.10
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '1.14'
32
+ version: '2'
27
33
  - !ruby/object:Gem::Dependency
28
- name: rake
34
+ name: sentry-ruby
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - "<"
32
38
  - !ruby/object:Gem::Version
33
- version: '12.0'
34
- type: :development
39
+ version: '5'
40
+ type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - "~>"
44
+ - - "<"
39
45
  - !ruby/object:Gem::Version
40
- version: '12.0'
46
+ version: '5'
41
47
  - !ruby/object:Gem::Dependency
42
- name: test-unit
48
+ name: bundler
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - "~>"
51
+ - - ">="
46
52
  - !ruby/object:Gem::Version
47
- version: '3.0'
53
+ version: '0'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - "~>"
58
+ - - ">="
53
59
  - !ruby/object:Gem::Version
54
- version: '3.0'
60
+ version: '0'
55
61
  - !ruby/object:Gem::Dependency
56
- name: fluentd
62
+ name: rake
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - ">="
60
66
  - !ruby/object:Gem::Version
61
- version: 0.14.10
62
- - - "<"
63
- - !ruby/object:Gem::Version
64
- version: '2'
65
- type: :runtime
67
+ version: '0'
68
+ type: :development
66
69
  prerelease: false
67
70
  version_requirements: !ruby/object:Gem::Requirement
68
71
  requirements:
69
72
  - - ">="
70
73
  - !ruby/object:Gem::Version
71
- version: 0.14.10
72
- - - "<"
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rubocop-rake
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
73
80
  - !ruby/object:Gem::Version
74
- version: '2'
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
75
89
  - !ruby/object:Gem::Dependency
76
- name: sentry-raven
90
+ name: test-unit
77
91
  requirement: !ruby/object:Gem::Requirement
78
92
  requirements:
79
- - - ">"
93
+ - - ">="
80
94
  - !ruby/object:Gem::Version
81
- version: '2'
82
- type: :runtime
95
+ version: '0'
96
+ type: :development
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
- - - ">"
100
+ - - ">="
87
101
  - !ruby/object:Gem::Version
88
- version: '2'
102
+ version: '0'
89
103
  description: sentry output plugin for Fluentd
90
104
  email:
91
105
  - yuutoo.advance@gmail.com
@@ -93,12 +107,13 @@ executables: []
93
107
  extensions: []
94
108
  extra_rdoc_files: []
95
109
  files:
110
+ - ".github/workflows/test.yaml"
96
111
  - ".gitignore"
97
- - ".travis.yml"
98
112
  - Gemfile
99
113
  - LICENSE
100
114
  - README.md
101
115
  - Rakefile
116
+ - example/fluentd.conf
102
117
  - fluent-plugin-raven.gemspec
103
118
  - lib/fluent/plugin/out_raven.rb
104
119
  - test/helper.rb
@@ -115,14 +130,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
130
  requirements:
116
131
  - - ">="
117
132
  - !ruby/object:Gem::Version
118
- version: '0'
133
+ version: '2.5'
119
134
  required_rubygems_version: !ruby/object:Gem::Requirement
120
135
  requirements:
121
136
  - - ">="
122
137
  - !ruby/object:Gem::Version
123
138
  version: '0'
124
139
  requirements: []
125
- rubygems_version: 3.1.2
140
+ rubygems_version: 3.0.3
126
141
  signing_key:
127
142
  specification_version: 4
128
143
  summary: sentry output plugin for Fluentd
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- os: linux
2
- language: ruby
3
-
4
- rvm:
5
- - 2.6
6
- - 2.5
7
- - 2.4
8
- - 2.3