fluent-plugin-cloudwatch-logs 0.7.6 → 0.8.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: 4d3fc1e18139a9a9b3e08b6df6bf8b25e7c239d1031550e5eb5496f323cefcb0
4
- data.tar.gz: 383fb66f3c5b081352d920d93688dacb4bb5e2ffb7b2acb323a26e4b3fb46525
3
+ metadata.gz: 7b005354b842b8dfcc7e1106d762a9b5db691f6d32c8a254910ab98c125ea62c
4
+ data.tar.gz: 6f7198ffd262247b2f600ae8b27cad5246954c2d050f10ce32b2e182adfd9cc6
5
5
  SHA512:
6
- metadata.gz: e4c8e46ddcd8c9aea6576fcbf7bc05fc4125aa89f96e0fe2d1edf7f1b910195c59a1eda7fce229b25f6b909fd9abc02be8aaf7f6efe2cc0f66899ead811ada92
7
- data.tar.gz: f30ac4839ff562af3daf90a5a93e326d9cc9922986957dd96da1d1e3b19f0fd463f6cdc482268486c8c3180674800492800ecf317ae18cfdc6add52ff15ce783
6
+ metadata.gz: 10b5035a2f3d3669c61e51cf4b3aed7fa6d001b26351228cc4eb1dff863ddd0c9846e09be519efadf2914b488fa7e6c471d9e86c199f167c1def428391e4493b
7
+ data.tar.gz: 3415f0bdb2bd70dcb1cb199ed1eb32d17998699ee519f0eba57ad67a379b7815d8648d7d2f31f9b84fdf10c6ac96d856661a9e4ba245dd734ba13e91cb5af933
data/README.md CHANGED
@@ -8,7 +8,8 @@
8
8
 
9
9
  |fluent-plugin-cloudwatch-logs| fluentd | ruby |
10
10
  |-----------------------------|------------------|--------|
11
- | >= 0.5.0 | >= 0.14.15 | >= 2.1 |
11
+ | >= 0.8.0 | >= 1.8.0 | >= 2.4 |
12
+ | >= 0.5.0 && < 0.8.0 | >= 0.14.15 | >= 2.1 |
12
13
  | <= 0.4.5 | ~> 0.12.0 * | >= 1.9 |
13
14
 
14
15
  * May not support all future fluentd features
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency 'fluentd', '>= 0.14.15'
20
+ spec.add_dependency 'fluentd', '>= 1.8.0'
21
21
  spec.add_dependency 'aws-sdk-cloudwatchlogs', '~> 1.0'
22
22
 
23
23
  spec.add_development_dependency "bundler"
@@ -2,7 +2,7 @@ module Fluent
2
2
  module Plugin
3
3
  module Cloudwatch
4
4
  module Logs
5
- VERSION = "0.7.6"
5
+ VERSION = "0.8.0"
6
6
  end
7
7
  end
8
8
  end
@@ -1,4 +1,5 @@
1
1
  require 'fluent/plugin/output'
2
+ require 'fluent/msgpack_factory'
2
3
  require 'thread'
3
4
  require 'yajl'
4
5
 
@@ -116,7 +117,7 @@ module Fluent::Plugin
116
117
 
117
118
  def format(tag, time, record)
118
119
  record = inject_values_to_record(tag, time, record)
119
- msgpack_packer.pack([tag, time, record]).to_s
120
+ Fluent::MessagePackFactory.msgpack_packer.pack([tag, time, record]).to_s
120
121
  end
121
122
 
122
123
  def formatted_to_msgpack_binary?
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
- require 'test_helper'
2
+ require_relative '../test_helper'
3
3
  require 'fileutils'
4
4
  require 'fluent/test/driver/output'
5
5
  require 'fluent/test/helpers'
@@ -544,7 +544,7 @@ class CloudwatchLogsOutputTest < Test::Unit::TestCase
544
544
  end
545
545
  end
546
546
 
547
- assert_match(/failed to set retention policy for Log group/, d.logs[0])
547
+ assert(d.logs.any?{|log| log.include?("failed to set retention policy for Log group")})
548
548
  end
549
549
 
550
550
  def test_log_group_aws_tags_key
@@ -652,12 +652,15 @@ class CloudwatchLogsOutputTest < Test::Unit::TestCase
652
652
  end
653
653
 
654
654
  def test_retrying_on_throttling_exception
655
- resp = mock()
656
- resp.expects(:rejected_log_events_info)
657
- resp.expects(:next_sequence_token)
655
+ resp = Object.new
656
+ mock(resp).rejected_log_events_info {}
657
+ mock(resp).next_sequence_token {}
658
658
  client = Aws::CloudWatchLogs::Client.new
659
- client.stubs(:put_log_events).
660
- raises(Aws::CloudWatchLogs::Errors::ThrottlingException.new(nil, "error")).then.returns(resp)
659
+ @called = false
660
+ stub(client).put_log_events(anything) {
661
+ raise(Aws::CloudWatchLogs::Errors::ThrottlingException.new(nil, "error"))
662
+ }.once.ordered
663
+ stub(client).put_log_events(anything) { resp }.once.ordered
661
664
 
662
665
  d = create_driver
663
666
  time = event_time
@@ -674,8 +677,9 @@ class CloudwatchLogsOutputTest < Test::Unit::TestCase
674
677
 
675
678
  def test_retrying_on_throttling_exception_and_throw_away
676
679
  client = Aws::CloudWatchLogs::Client.new
677
- client.stubs(:put_log_events).
678
- raises(Aws::CloudWatchLogs::Errors::ThrottlingException.new(nil, "error"))
680
+ mock(client).put_log_events(anything).times(any_times) {
681
+ raise(Aws::CloudWatchLogs::Errors::ThrottlingException.new(nil, "error"))
682
+ }
679
683
  time = Fluent::Engine.now
680
684
  d = create_driver(<<-EOC)
681
685
  #{default_config}
@@ -708,7 +712,7 @@ class CloudwatchLogsOutputTest < Test::Unit::TestCase
708
712
  end
709
713
 
710
714
  logs = d.logs
711
- assert(logs.any?{|log| log.include?("Log event is discarded because it is too large: 262184 bytes exceeds limit of 262144")})
715
+ assert(logs.any?{|log| log =~ /Log event in .* discarded because it is too large: 262184 bytes exceeds limit of 262144/})
712
716
  end
713
717
  end
714
718
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch-logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-18 00:00:00.000000000 Z
11
+ date: 2020-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.15
19
+ version: 1.8.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.14.15
26
+ version: 1.8.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: aws-sdk-cloudwatchlogs
29
29
  requirement: !ruby/object:Gem::Requirement