fluent-plugin-google-cloud 0.6.5 → 0.6.6
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 +4 -4
- data/Gemfile.lock +5 -5
- data/fluent-plugin-google-cloud.gemspec +1 -1
- data/lib/fluent/plugin/out_google_cloud.rb +1 -18
- data/test/plugin/base_test.rb +0 -41
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dc5ad48b790072401a4ed3d0b48e02e57a2a697
|
4
|
+
data.tar.gz: e11801bebd08a12a47f7e84332fc72db19463772
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2340a5b449123bbb88ba39ac155856f3561820e9a8468593aae5cc81a1b871b4602ce8a0143a7e3c909f10cedcf0515e5b297959da92ab23a3e0046025694026
|
7
|
+
data.tar.gz: b66cc54e2372fbf79c2a2fd20828417a9dfef516e5ff5dce16b9b7af66644c7bf9a283dbcd17c9b1d54cfebaa5eb989695608f429db0f1db6869dfe385b00ec0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent-plugin-google-cloud (0.6.
|
4
|
+
fluent-plugin-google-cloud (0.6.6)
|
5
5
|
fluentd (~> 0.10)
|
6
6
|
google-api-client (~> 0.9.0)
|
7
7
|
google-cloud-logging (= 0.24.1)
|
@@ -13,8 +13,8 @@ PATH
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
15
15
|
specs:
|
16
|
-
addressable (2.5.
|
17
|
-
public_suffix (
|
16
|
+
addressable (2.5.2)
|
17
|
+
public_suffix (>= 2.0.2, < 4.0)
|
18
18
|
ast (2.3.0)
|
19
19
|
astrolabe (1.3.1)
|
20
20
|
parser (~> 2.2)
|
@@ -85,7 +85,7 @@ GEM
|
|
85
85
|
mime-types (3.1)
|
86
86
|
mime-types-data (~> 3.2015)
|
87
87
|
mime-types-data (3.2016.0521)
|
88
|
-
mocha (1.
|
88
|
+
mocha (1.3.0)
|
89
89
|
metaclass (~> 0.0.1)
|
90
90
|
msgpack (1.1.0)
|
91
91
|
multi_json (1.12.1)
|
@@ -97,7 +97,7 @@ GEM
|
|
97
97
|
powerpack (0.1.1)
|
98
98
|
prometheus-client (0.7.1)
|
99
99
|
quantile (~> 0.2.0)
|
100
|
-
public_suffix (
|
100
|
+
public_suffix (3.0.0)
|
101
101
|
quantile (0.2.0)
|
102
102
|
rainbow (2.2.2)
|
103
103
|
rake
|
@@ -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.
|
13
|
+
gem.version = '0.6.6'
|
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')
|
@@ -98,7 +98,6 @@ module Fluent
|
|
98
98
|
# Default values for JSON payload keys to set the "trace",
|
99
99
|
# "sourceLocation", "operation" and "labels" fields in the LogEntry.
|
100
100
|
DEFAULT_PAYLOAD_KEY_PREFIX = 'logging.googleapis.com'
|
101
|
-
DEFAULT_LABELS_KEY = "#{DEFAULT_PAYLOAD_KEY_PREFIX}/labels"
|
102
101
|
DEFAULT_HTTP_REQUEST_KEY = 'httpRequest'
|
103
102
|
DEFAULT_OPERATION_KEY = "#{DEFAULT_PAYLOAD_KEY_PREFIX}/operation"
|
104
103
|
DEFAULT_SOURCE_LOCATION_KEY =
|
@@ -161,7 +160,7 @@ module Fluent
|
|
161
160
|
Fluent::Plugin.register_output('google_cloud', self)
|
162
161
|
|
163
162
|
PLUGIN_NAME = 'Fluentd Google Cloud Logging plugin'
|
164
|
-
PLUGIN_VERSION = '0.6.
|
163
|
+
PLUGIN_VERSION = '0.6.6'
|
165
164
|
|
166
165
|
# Name of the the Google cloud logging write scope.
|
167
166
|
LOGGING_SCOPE = 'https://www.googleapis.com/auth/logging.write'
|
@@ -192,7 +191,6 @@ module Fluent
|
|
192
191
|
config_param :vm_name, :string, :default => nil
|
193
192
|
|
194
193
|
# Map keys from a JSON payload to corresponding LogEntry fields.
|
195
|
-
config_param :labels_key, :string, :default => DEFAULT_LABELS_KEY
|
196
194
|
config_param :http_request_key, :string, :default =>
|
197
195
|
DEFAULT_HTTP_REQUEST_KEY
|
198
196
|
config_param :operation_key, :string, :default => DEFAULT_OPERATION_KEY
|
@@ -523,7 +521,6 @@ module Fluent
|
|
523
521
|
entry.trace = fq_trace_id if fq_trace_id
|
524
522
|
|
525
523
|
set_log_entry_fields(record, entry)
|
526
|
-
set_labels(record, entry)
|
527
524
|
|
528
525
|
if @use_grpc
|
529
526
|
set_payload_grpc(entry_resource.type, record, entry, is_json)
|
@@ -1285,20 +1282,6 @@ module Fluent
|
|
1285
1282
|
end
|
1286
1283
|
end
|
1287
1284
|
|
1288
|
-
def set_labels(record, entry)
|
1289
|
-
record_labels = record[@labels_key]
|
1290
|
-
return nil unless record_labels.is_a?(Hash)
|
1291
|
-
|
1292
|
-
record_labels.each do |key, value|
|
1293
|
-
unless entry.labels.key?(key)
|
1294
|
-
record_labels.delete(key)
|
1295
|
-
entry.labels[key] = value
|
1296
|
-
end
|
1297
|
-
end
|
1298
|
-
|
1299
|
-
record.delete(@labels_key) if record_labels.empty?
|
1300
|
-
end
|
1301
|
-
|
1302
1285
|
# Values permitted by the API for 'severity' (which is an enum).
|
1303
1286
|
VALID_SEVERITIES = Set.new(
|
1304
1287
|
%w(DEFAULT DEBUG INFO NOTICE WARNING ERROR CRITICAL ALERT EMERGENCY))
|
data/test/plugin/base_test.rb
CHANGED
@@ -952,47 +952,6 @@ module BaseTest
|
|
952
952
|
end
|
953
953
|
end
|
954
954
|
|
955
|
-
def test_labels_from_record
|
956
|
-
setup_gce_metadata_stubs
|
957
|
-
setup_logging_stubs do
|
958
|
-
d = create_driver
|
959
|
-
d.emit(DEFAULT_LABELS_KEY => CUSTOM_LABELS_MESSAGE)
|
960
|
-
d.run
|
961
|
-
end
|
962
|
-
labels = COMPUTE_PARAMS[:labels].merge(CUSTOM_LABELS_MESSAGE)
|
963
|
-
params = COMPUTE_PARAMS.merge(labels: labels)
|
964
|
-
verify_log_entries(1, params, 'labels') do |entry|
|
965
|
-
assert_nil get_fields(entry['jsonPayload'])[DEFAULT_LABELS_KEY], entry
|
966
|
-
end
|
967
|
-
end
|
968
|
-
|
969
|
-
def test_labels_from_record_conflict
|
970
|
-
setup_gce_metadata_stubs
|
971
|
-
setup_logging_stubs do
|
972
|
-
d = create_driver
|
973
|
-
d.emit(DEFAULT_LABELS_KEY => { CONFLICTING_LABEL_KEY => 'a_string' })
|
974
|
-
d.run
|
975
|
-
end
|
976
|
-
verify_log_entries(1, COMPUTE_PARAMS, 'jsonPayload') do |entry|
|
977
|
-
fields = get_fields(entry['jsonPayload'])
|
978
|
-
labels = get_fields(get_struct(fields[DEFAULT_LABELS_KEY]))
|
979
|
-
assert_equal('a_string', get_string(labels[CONFLICTING_LABEL_KEY]), entry)
|
980
|
-
end
|
981
|
-
end
|
982
|
-
|
983
|
-
def test_labels_from_record_when_not_hash
|
984
|
-
setup_gce_metadata_stubs
|
985
|
-
setup_logging_stubs do
|
986
|
-
d = create_driver
|
987
|
-
d.emit(DEFAULT_LABELS_KEY => 'a_string')
|
988
|
-
d.run
|
989
|
-
end
|
990
|
-
verify_log_entries(1, COMPUTE_PARAMS, 'jsonPayload') do |entry|
|
991
|
-
fields = get_fields(entry['jsonPayload'])
|
992
|
-
assert_equal 'a_string', get_string(fields[DEFAULT_LABELS_KEY]), entry
|
993
|
-
end
|
994
|
-
end
|
995
|
-
|
996
955
|
def test_log_entry_trace_field
|
997
956
|
setup_gce_metadata_stubs
|
998
957
|
message = log_entry(0)
|
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.
|
4
|
+
version: 0.6.6
|
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: 2017-08-
|
12
|
+
date: 2017-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|