fluent-plugin-google-cloud 0.6.11.pre.memory.4 → 0.6.11.pre.memory.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
  SHA1:
3
- metadata.gz: bd955541152f073cb50a4a498a52576711b93ef6
4
- data.tar.gz: 33428753b4acf5789e06255b6ede9c82da202027
3
+ metadata.gz: 903a5c262eaacad2451507c794d26267229ccf8c
4
+ data.tar.gz: 0ba356652e9471fddd2c766e68268d0919ec5967
5
5
  SHA512:
6
- metadata.gz: df9e9e4f685d96fb1b30f082e981c00487239490fb84acfb7530295e01b877e960c384fc3ac2762e0fa57354c5c756e337d0641379930ab68492b8c30eea0b4f
7
- data.tar.gz: 25a06238933c029af630fd546707b263da38763233b668e8fb2568eab448e727865ca30d2bfd23653f1af9b250f95e9bf54af6e703b58142e5084f914806f131
6
+ metadata.gz: c8999f8a324fb4f44c03dfc0a27a8ef7f98fd8397a59983eef303e6741ede5e281bac8e19ab635ed977e883c2e7c9f3d6d4f6b94e61c08cd12727fd4b4c14543
7
+ data.tar.gz: a968571c3db6792d3984842b4ef8eb04768967bf8ace7146ed04eec95a6eae3f91a2fccc28206dfa289f97d47bb6eebcbcd2476b6439d3087cc2eddc4f37cafb
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-google-cloud (0.6.11.pre.memory.4)
4
+ fluent-plugin-google-cloud (0.6.11.pre.memory.5)
5
5
  fluentd (~> 0.10)
6
6
  google-api-client (~> 0.14)
7
- google-cloud-logging (= 1.2.3)
7
+ google-cloud-logging (~> 1.2.3)
8
8
  googleapis-common-protos (~> 1.3)
9
9
  googleauth (~> 0.5)
10
- grpc (= 1.2.5)
10
+ grpc (~> 1.2.5)
11
11
  json (~> 1.8)
12
12
 
13
13
  GEM
@@ -10,7 +10,7 @@ eos
10
10
  gem.homepage =
11
11
  'https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud'
12
12
  gem.license = 'Apache-2.0'
13
- gem.version = '0.6.11.pre.memory.4'
13
+ gem.version = '0.6.11.pre.memory.5'
14
14
  gem.authors = ['Todd Derr', 'Alex Robinson']
15
15
  gem.email = ['salty@google.com']
16
16
  gem.required_ruby_version = Gem::Requirement.new('>= 2.0')
@@ -22,9 +22,9 @@ eos
22
22
  gem.add_runtime_dependency 'fluentd', '~> 0.10'
23
23
  gem.add_runtime_dependency 'googleapis-common-protos', '~> 1.3'
24
24
  gem.add_runtime_dependency 'google-api-client', '~> 0.14'
25
- gem.add_runtime_dependency 'google-cloud-logging', '1.2.3'
25
+ gem.add_runtime_dependency 'google-cloud-logging', '~> 1.2.3'
26
26
  gem.add_runtime_dependency 'googleauth', '~> 0.5'
27
- gem.add_runtime_dependency 'grpc', '1.2.5'
27
+ gem.add_runtime_dependency 'grpc', '~> 1.2.5'
28
28
  gem.add_runtime_dependency 'json', '~> 1.8'
29
29
 
30
30
  gem.add_development_dependency 'mocha', '~> 1.1'
@@ -195,7 +195,7 @@ module Fluent
195
195
  Fluent::Plugin.register_output('google_cloud', self)
196
196
 
197
197
  PLUGIN_NAME = 'Fluentd Google Cloud Logging plugin'.freeze
198
- PLUGIN_VERSION = '0.6.11.pre.memory.4'.freeze
198
+ PLUGIN_VERSION = '0.6.11.pre.memory.5'.freeze
199
199
 
200
200
  # Name of the the Google cloud logging write scope.
201
201
  LOGGING_SCOPE = 'https://www.googleapis.com/auth/logging.write'.freeze
@@ -598,7 +598,6 @@ module Fluent
598
598
  rescue Google::Gax::GaxError => gax_error
599
599
  # GRPC::BadStatus is wrapped in error.cause.
600
600
  error = gax_error.cause
601
- increment_failed_requests_count(error.code)
602
601
 
603
602
  # See the mapping between HTTP status and gRPC status code at:
604
603
  # https://github.com/grpc/grpc/blob/master/src/core/lib/transport/status_conversion.cc
@@ -644,12 +643,14 @@ module Fluent
644
643
  # This decision is made to avoid retrying forever due to client
645
644
  # errors.
646
645
  GRPC::Unknown
646
+ increment_failed_requests_count(error.code)
647
647
  increment_dropped_entries_count(entries_count, error.code)
648
648
  @log.warn "Dropping #{entries_count} log message(s)",
649
649
  error: error.to_s, error_code: error.code.to_s
650
650
 
651
651
  else
652
652
  # Assume it is a problem with the request itself and don't retry.
653
+ increment_failed_requests_count(error.code)
653
654
  increment_dropped_entries_count(entries_count, error.code)
654
655
  @log.error "Unknown response code #{error.code} from the "\
655
656
  "server, dropping #{entries_count} log message(s)",
@@ -666,16 +667,10 @@ module Fluent
666
667
  partial_success: @partial_success,
667
668
  entries: entries)
668
669
  entries_count = entries.length
669
-
670
- begin
671
- client.write_entry_log_entries(
672
- write_request,
673
- options: { api_format_version: '2' }
674
- )
675
- rescue Google::Apis::Error => error
676
- increment_failed_requests_count(error.status_code)
677
- raise error
678
- end
670
+ client.write_entry_log_entries(
671
+ write_request,
672
+ options: { api_format_version: '2' }
673
+ )
679
674
 
680
675
  increment_successful_requests_count
681
676
  increment_ingested_entries_count(entries_count)
@@ -698,6 +693,7 @@ module Fluent
698
693
  # 401 authorization error.
699
694
  # These are usually solved via a `gcloud auth` call, or by modifying
700
695
  # the permissions on the Google Cloud project.
696
+ increment_failed_requests_count(error.status_code)
701
697
  increment_dropped_entries_count(entries_count, error.status_code)
702
698
  @log.warn "Dropping #{entries_count} log message(s)",
703
699
  error_class: error.class.to_s, error: error.to_s
@@ -707,6 +703,7 @@ module Fluent
707
703
  # request itself and should not be retried.
708
704
  error_details_map = construct_error_details_map(error)
709
705
  if error_details_map.empty?
706
+ increment_failed_requests_count(error.status_code)
710
707
  increment_dropped_entries_count(entries_count, error.status_code)
711
708
  @log.warn "Dropping #{entries_count} log message(s)",
712
709
  error_class: error.class.to_s, error: error.to_s
@@ -719,6 +716,8 @@ module Fluent
719
716
  error_code: "google.rpc.Code[#{error_code}]",
720
717
  error: error_message
721
718
  end
719
+ # Consider partially successful requests successful.
720
+ increment_successful_requests_count
722
721
  increment_ingested_entries_count(entries_count)
723
722
  end
724
723
  end
@@ -66,9 +66,9 @@ class GoogleCloudOutputTest < Test::Unit::TestCase
66
66
  end
67
67
  d.run
68
68
  assert_prometheus_metric_value(
69
- :stackdriver_successful_requests_count, 0, grpc: false, code: 200)
69
+ :stackdriver_successful_requests_count, 1, grpc: false, code: 200)
70
70
  assert_prometheus_metric_value(
71
- :stackdriver_failed_requests_count, 1, grpc: false, code: root_error_code)
71
+ :stackdriver_failed_requests_count, 0, grpc: false)
72
72
  assert_prometheus_metric_value(
73
73
  :stackdriver_ingested_entries_count, 1, grpc: false, code: 200)
74
74
  assert_prometheus_metric_value(
@@ -115,7 +115,7 @@ class GoogleCloudOutputTest < Test::Unit::TestCase
115
115
  [401, 1, 1, [0, 1, 0, 1, 0]],
116
116
  # Single failed request that escalates without logs being dropped with
117
117
  # several entries.
118
- [500, 1, 2, [0, 1, 0, 0, 2]]
118
+ [500, 1, 2, [0, 0, 0, 0, 2]]
119
119
  ].each do |code, request_count, entry_count, metric_values|
120
120
  setup_prometheus
121
121
  # TODO: Do this as part of setup_logging_stubs.
@@ -92,7 +92,7 @@ class GoogleCloudOutputGRPCTest < Test::Unit::TestCase
92
92
  [true, 16, 1, 1, [0, 1, 0, 1, 0]],
93
93
  # Single failed request that escalates without logs being dropped with
94
94
  # several entries.
95
- [true, 13, 1, 2, [0, 1, 0, 0, 2]]
95
+ [true, 13, 1, 2, [0, 0, 0, 0, 2]]
96
96
  ].each do |should_fail, code, request_count, entry_count, metric_values|
97
97
  setup_prometheus
98
98
  (1..request_count).each do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-google-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11.pre.memory.4
4
+ version: 0.6.11.pre.memory.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Derr
@@ -57,14 +57,14 @@ dependencies:
57
57
  name: google-cloud-logging
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '='
60
+ - - "~>"
61
61
  - !ruby/object:Gem::Version
62
62
  version: 1.2.3
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '='
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: 1.2.3
70
70
  - !ruby/object:Gem::Dependency
@@ -85,14 +85,14 @@ dependencies:
85
85
  name: grpc
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '='
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
90
  version: 1.2.5
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '='
95
+ - - "~>"
96
96
  - !ruby/object:Gem::Version
97
97
  version: 1.2.5
98
98
  - !ruby/object:Gem::Dependency