fluent-plugin-google-cloud 0.5.3 → 0.5.4.grpc.alpha.1

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
  SHA1:
3
- metadata.gz: 799581f71590ea1a87c3759408ee4b75f6a57ea6
4
- data.tar.gz: f74f2fd1580a55e4bcde081ae1e08863ed60f859
3
+ metadata.gz: 279a5869d141b67bf177d86ccef404872802947c
4
+ data.tar.gz: 74ece7ba6616ff4e510b06bcc9b2287d146c9c13
5
5
  SHA512:
6
- metadata.gz: 4cf57aeaa8fae53674a1bafc73d0dc7a5e1558c2abc06b38616e8a696f1182d54f8b081747e55191848d72ebfa601629074ea0393ffb6c0bd086e99f145b2985
7
- data.tar.gz: fef39d57aaf678fa775424ead370ed06cfa0e978cf750c5c64c31af59cd57174cc287040c1f612110de0df8bed13302792d577e25a1e6d437ed0848f8919f276
6
+ metadata.gz: c05545b62bc7103287f7d56107c067891cd0c60acce2966b8b2279ad509421608854ec58b7a02c1f8bc312e8e8a9b32c92e0dfa3c7b7a2e708467ba2f368ef7b
7
+ data.tar.gz: 270899d53a66a128760d965a32115ce9d23bda50e03b00c7bc06c49d0d81f3b79e3ccee26e1eeec5c7db48faaa9fb987acf4a9d938f73cfd68a368b470f3ec40
data/Gemfile.lock ADDED
@@ -0,0 +1,135 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ fluent-plugin-google-cloud (0.5.4.grpc.alpha.1)
5
+ fluentd (~> 0.10)
6
+ google-api-client (> 0.9)
7
+ googleapis-common-protos (~> 1.3)
8
+ googleauth (~> 0.4)
9
+ grpc (~> 1.0)
10
+ json (~> 1.8)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ addressable (2.5.0)
16
+ public_suffix (~> 2.0, >= 2.0.2)
17
+ ast (2.3.0)
18
+ astrolabe (1.3.1)
19
+ parser (~> 2.2)
20
+ cool.io (1.4.5)
21
+ crack (0.4.3)
22
+ safe_yaml (~> 1.0.0)
23
+ faraday (0.10.1)
24
+ multipart-post (>= 1.2, < 3)
25
+ fluentd (0.14.11)
26
+ cool.io (~> 1.4.5)
27
+ http_parser.rb (>= 0.5.1, < 0.7.0)
28
+ msgpack (>= 0.7.0, < 2.0.0)
29
+ serverengine (>= 2.0.4, < 3.0.0)
30
+ sigdump (~> 0.2.2)
31
+ strptime (~> 0.1.7)
32
+ tzinfo (~> 1.0)
33
+ tzinfo-data (~> 1.0)
34
+ yajl-ruby (~> 1.0)
35
+ google-api-client (0.9.20)
36
+ addressable (~> 2.3)
37
+ googleauth (~> 0.5)
38
+ httpclient (~> 2.7)
39
+ hurley (~> 0.1)
40
+ memoist (~> 0.11)
41
+ mime-types (>= 1.6)
42
+ representable (~> 2.3.0)
43
+ retriable (~> 2.0)
44
+ google-protobuf (3.0.2)
45
+ googleapis-common-protos (1.3.4)
46
+ google-protobuf (~> 3.0)
47
+ grpc (~> 1.0)
48
+ googleauth (0.5.1)
49
+ faraday (~> 0.9)
50
+ jwt (~> 1.4)
51
+ logging (~> 2.0)
52
+ memoist (~> 0.12)
53
+ multi_json (~> 1.11)
54
+ os (~> 0.9)
55
+ signet (~> 0.7)
56
+ grpc (1.0.1)
57
+ google-protobuf (~> 3.0.2)
58
+ googleauth (~> 0.5.1)
59
+ hashdiff (0.3.2)
60
+ http_parser.rb (0.6.0)
61
+ httpclient (2.8.3)
62
+ hurley (0.2)
63
+ json (1.8.3)
64
+ jwt (1.5.6)
65
+ little-plugger (1.1.4)
66
+ logging (2.1.0)
67
+ little-plugger (~> 1.1)
68
+ multi_json (~> 1.10)
69
+ memoist (0.15.0)
70
+ metaclass (0.0.4)
71
+ mime-types (3.1)
72
+ mime-types-data (~> 3.2015)
73
+ mime-types-data (3.2016.0521)
74
+ mocha (1.2.1)
75
+ metaclass (~> 0.0.1)
76
+ msgpack (1.0.2)
77
+ multi_json (1.12.1)
78
+ multipart-post (2.0.0)
79
+ os (0.9.6)
80
+ parser (2.3.3.1)
81
+ ast (~> 2.2)
82
+ power_assert (0.4.1)
83
+ powerpack (0.1.1)
84
+ public_suffix (2.0.5)
85
+ rainbow (2.2.1)
86
+ rake (10.5.0)
87
+ representable (2.3.0)
88
+ uber (~> 0.0.7)
89
+ retriable (2.1.0)
90
+ rubocop (0.35.1)
91
+ astrolabe (~> 1.3)
92
+ parser (>= 2.2.3.0, < 3.0)
93
+ powerpack (~> 0.1)
94
+ rainbow (>= 1.99.1, < 3.0)
95
+ ruby-progressbar (~> 1.7)
96
+ tins (<= 1.6.0)
97
+ ruby-progressbar (1.8.1)
98
+ safe_yaml (1.0.4)
99
+ serverengine (2.0.4)
100
+ sigdump (~> 0.2.2)
101
+ sigdump (0.2.4)
102
+ signet (0.7.3)
103
+ addressable (~> 2.3)
104
+ faraday (~> 0.9)
105
+ jwt (~> 1.5)
106
+ multi_json (~> 1.10)
107
+ strptime (0.1.8)
108
+ test-unit (3.2.3)
109
+ power_assert
110
+ thread_safe (0.3.5)
111
+ tins (1.6.0)
112
+ tzinfo (1.2.2)
113
+ thread_safe (~> 0.1)
114
+ tzinfo-data (1.2016.10)
115
+ tzinfo (>= 1.0.0)
116
+ uber (0.0.15)
117
+ webmock (1.24.6)
118
+ addressable (>= 2.3.6)
119
+ crack (>= 0.3.2)
120
+ hashdiff
121
+ yajl-ruby (1.3.0)
122
+
123
+ PLATFORMS
124
+ ruby
125
+
126
+ DEPENDENCIES
127
+ fluent-plugin-google-cloud!
128
+ mocha (~> 1.1)
129
+ rake (~> 10.3)
130
+ rubocop (~> 0.35.0)
131
+ test-unit (~> 3.0)
132
+ webmock (~> 1.17)
133
+
134
+ BUNDLED WITH
135
+ 1.13.7
@@ -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.5.3'
13
+ gem.version = '0.5.4.grpc.alpha.1'
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')
@@ -39,7 +39,7 @@ module Fluent
39
39
  Fluent::Plugin.register_output('google_cloud', self)
40
40
 
41
41
  PLUGIN_NAME = 'Fluentd Google Cloud Logging plugin'
42
- PLUGIN_VERSION = '0.5.3'
42
+ PLUGIN_VERSION = '0.5.4.grpc.alpha.1'
43
43
 
44
44
  # Constants for service names.
45
45
  APPENGINE_SERVICE = 'appengine.googleapis.com'
@@ -1044,7 +1044,7 @@ module Fluent
1044
1044
  def struct_from_ruby(hash)
1045
1045
  ret = Google::Protobuf::Struct.new
1046
1046
  hash.each do |k, v|
1047
- ret.fields[k] ||= value_from_ruby(v)
1047
+ ret.fields[convert_to_utf8(k.to_s)] ||= value_from_ruby(v)
1048
1048
  end
1049
1049
  ret
1050
1050
  end
@@ -544,6 +544,36 @@ module BaseTest
544
544
  end
545
545
  end
546
546
 
547
+ def test_struct_payload_malformatted_log
548
+ setup_gce_metadata_stubs
549
+ message = 'test message'
550
+ setup_logging_stubs do
551
+ d = create_driver
552
+ d.emit(
553
+ 'int_key' => { 1 => message },
554
+ 'array_key' => { [1, 2, 3, 4] => message },
555
+ 'hash_key' => { { 'some_key' => 'some_value' } => message },
556
+ 'symbol_key' => { some_symbol: message },
557
+ 'nil_key' => { nil => message }
558
+ )
559
+ d.run
560
+ end
561
+ verify_log_entries(1, COMPUTE_PARAMS, 'structPayload') do |entry|
562
+ fields = get_fields(entry['structPayload'])
563
+ assert_equal 5, fields.size, entry
564
+ assert_equal message, get_string(get_fields(get_struct(fields \
565
+ ['int_key']))['1']), entry
566
+ assert_equal message, get_string(get_fields(get_struct(fields \
567
+ ['array_key']))['[1, 2, 3, 4]']), entry
568
+ assert_equal message, get_string(get_fields(get_struct(fields \
569
+ ['hash_key']))['{"some_key"=>"some_value"}']), entry
570
+ assert_equal message, get_string(get_fields(get_struct(fields \
571
+ ['symbol_key']))['some_symbol']), entry
572
+ assert_equal message, get_string(get_fields(get_struct(fields \
573
+ ['nil_key']))['']), entry
574
+ end
575
+ end
576
+
547
577
  def test_struct_payload_json_log
548
578
  setup_gce_metadata_stubs
549
579
  setup_logging_stubs do
@@ -131,6 +131,30 @@ class GoogleCloudOutputGRPCTest < Test::Unit::TestCase
131
131
  end
132
132
  end
133
133
 
134
+ def test_struct_payload_non_utf8_log
135
+ setup_gce_metadata_stubs
136
+ setup_logging_stubs do
137
+ d = create_driver
138
+ d.emit('msg' => log_entry(0),
139
+ 'normal_key' => "test#{non_utf8_character}non utf8",
140
+ "non_utf8#{non_utf8_character}key" => 5000,
141
+ 'nested_struct' => { "non_utf8#{non_utf8_character}key" => \
142
+ "test#{non_utf8_character}non utf8" },
143
+ 'null_field' => nil)
144
+ d.run
145
+ end
146
+ verify_log_entries(1, COMPUTE_PARAMS, 'structPayload') do |entry|
147
+ fields = get_fields(entry['structPayload'])
148
+ assert_equal 5, fields.size, entry
149
+ assert_equal 'test log entry 0', get_string(fields['msg']), entry
150
+ assert_equal 'test non utf8', get_string(fields['normal_key']), entry
151
+ assert_equal 5000, get_number(fields['non_utf8 key']), entry
152
+ assert_equal 'test non utf8', get_string(get_fields(get_struct(fields \
153
+ ['nested_struct']))['non_utf8 key']), entry
154
+ assert_equal null_value, fields['null_field'], entry
155
+ end
156
+ end
157
+
134
158
  private
135
159
 
136
160
  GRPC_MOCK_HOST = 'localhost:56789'
@@ -266,6 +290,11 @@ class GoogleCloudOutputGRPCTest < Test::Unit::TestCase
266
290
  verify_json_log_entries(n, params, payload_type, &block)
267
291
  end
268
292
 
293
+ # Use the right single quotation mark as the sample non-utf8 character.
294
+ def non_utf8_character
295
+ [0x92].pack('C*')
296
+ end
297
+
269
298
  # For an optional field with default values, Protobuf omits the field when it
270
299
  # is deserialized to json. So we need to add an extra check for gRPC which
271
300
  # uses Protobuf.
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.5.3
4
+ version: 0.5.4.grpc.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Derr
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-12-22 00:00:00.000000000 Z
12
+ date: 2017-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -178,6 +178,7 @@ extra_rdoc_files: []
178
178
  files:
179
179
  - CONTRIBUTING
180
180
  - Gemfile
181
+ - Gemfile.lock
181
182
  - LICENSE
182
183
  - README.rdoc
183
184
  - Rakefile
@@ -211,9 +212,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
211
212
  version: '2.0'
212
213
  required_rubygems_version: !ruby/object:Gem::Requirement
213
214
  requirements:
214
- - - ">="
215
+ - - ">"
215
216
  - !ruby/object:Gem::Version
216
- version: '0'
217
+ version: 1.3.1
217
218
  requirements: []
218
219
  rubyforge_project:
219
220
  rubygems_version: 2.4.8