fluent-plugin-google-cloud 0.7.13 → 0.7.14
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 +8 -8
- data/fluent-plugin-google-cloud.gemspec +1 -1
- data/lib/fluent/plugin/out_google_cloud.rb +11 -99
- data/test/plugin/base_test.rb +0 -90
- data/test/plugin/constants.rb +0 -56
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66acba1fe70f426b7ee4aa89bb1451404971f76a0af963c639b239f67db280f3
|
|
4
|
+
data.tar.gz: 391bc3714af4c0a474bb630458e9a073f4c3b4298bd7818e90c83d32c7c82cf9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3adaecad447e1cf9c0665c11468578e7f0808ab76044b491b2314972bcf60fe56afe94e7f442d4d92db93c206e77d80bd9ef05841491da1d76bbd49c951d2830
|
|
7
|
+
data.tar.gz: a34643f3e4693041280192de7586f363d14f204dc88964fb25b3022e96a4e25e064072672286720f02e5685db001088ca9549c534c9049ec5be689735a53ab0e
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
fluent-plugin-google-cloud (0.7.
|
|
4
|
+
fluent-plugin-google-cloud (0.7.14)
|
|
5
5
|
fluentd (= 1.4.2)
|
|
6
6
|
google-api-client (= 0.28.4)
|
|
7
7
|
google-cloud-logging (= 1.6.0)
|
|
@@ -47,7 +47,7 @@ GEM
|
|
|
47
47
|
signet (~> 0.10)
|
|
48
48
|
google-cloud-core (1.3.0)
|
|
49
49
|
google-cloud-env (~> 1.0)
|
|
50
|
-
google-cloud-env (1.0
|
|
50
|
+
google-cloud-env (1.2.0)
|
|
51
51
|
faraday (~> 0.11)
|
|
52
52
|
google-cloud-logging (1.6.0)
|
|
53
53
|
concurrent-ruby (~> 1.0)
|
|
@@ -55,7 +55,7 @@ GEM
|
|
|
55
55
|
google-gax (~> 1.3)
|
|
56
56
|
googleapis-common-protos-types (>= 1.0.2)
|
|
57
57
|
stackdriver-core (~> 1.3)
|
|
58
|
-
google-gax (1.
|
|
58
|
+
google-gax (1.6.3)
|
|
59
59
|
google-protobuf (~> 3.2)
|
|
60
60
|
googleapis-common-protos (>= 1.3.5, < 2.0)
|
|
61
61
|
googleauth (>= 0.6.2, < 0.10.0)
|
|
@@ -78,7 +78,7 @@ GEM
|
|
|
78
78
|
grpc (1.14.2)
|
|
79
79
|
google-protobuf (~> 3.1)
|
|
80
80
|
googleapis-common-protos-types (~> 1.0.0)
|
|
81
|
-
hashdiff (0.
|
|
81
|
+
hashdiff (0.4.0)
|
|
82
82
|
http_parser.rb (0.6.0)
|
|
83
83
|
httpclient (2.8.3)
|
|
84
84
|
json (2.1.0)
|
|
@@ -88,9 +88,9 @@ GEM
|
|
|
88
88
|
mime-types (3.2.2)
|
|
89
89
|
mime-types-data (~> 3.2015)
|
|
90
90
|
mime-types-data (3.2019.0331)
|
|
91
|
-
mocha (1.
|
|
91
|
+
mocha (1.9.0)
|
|
92
92
|
metaclass (~> 0.0.1)
|
|
93
|
-
msgpack (1.
|
|
93
|
+
msgpack (1.3.0)
|
|
94
94
|
multi_json (1.13.1)
|
|
95
95
|
multipart-post (2.1.1)
|
|
96
96
|
os (1.0.1)
|
|
@@ -100,7 +100,7 @@ GEM
|
|
|
100
100
|
powerpack (0.1.2)
|
|
101
101
|
prometheus-client (0.7.1)
|
|
102
102
|
quantile (~> 0.2.0)
|
|
103
|
-
public_suffix (3.0
|
|
103
|
+
public_suffix (3.1.0)
|
|
104
104
|
quantile (0.2.1)
|
|
105
105
|
rainbow (2.2.2)
|
|
106
106
|
rake
|
|
@@ -117,7 +117,7 @@ GEM
|
|
|
117
117
|
rainbow (>= 1.99.1, < 3.0)
|
|
118
118
|
ruby-progressbar (~> 1.7)
|
|
119
119
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
|
120
|
-
ruby-progressbar (1.10.
|
|
120
|
+
ruby-progressbar (1.10.1)
|
|
121
121
|
safe_yaml (1.0.5)
|
|
122
122
|
serverengine (2.1.1)
|
|
123
123
|
sigdump (~> 0.2.2)
|
|
@@ -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.7.
|
|
13
|
+
gem.version = '0.7.14'
|
|
14
14
|
gem.authors = ['Stackdriver Agents Team']
|
|
15
15
|
gem.email = ['stackdriver-agents@google.com']
|
|
16
16
|
gem.required_ruby_version = Gem::Requirement.new('>= 2.2')
|
|
@@ -60,14 +60,6 @@ module Fluent
|
|
|
60
60
|
resource_type: 'gae_app',
|
|
61
61
|
metadata_attributes: %w(gae_backend_name gae_backend_version)
|
|
62
62
|
}.freeze
|
|
63
|
-
CLOUDFUNCTIONS_CONSTANTS = {
|
|
64
|
-
service: 'cloudfunctions.googleapis.com',
|
|
65
|
-
resource_type: 'cloud_function',
|
|
66
|
-
stream_severity_map: {
|
|
67
|
-
'stdout' => 'INFO',
|
|
68
|
-
'stderr' => 'ERROR'
|
|
69
|
-
}
|
|
70
|
-
}.freeze
|
|
71
63
|
COMPUTE_CONSTANTS = {
|
|
72
64
|
service: 'compute.googleapis.com',
|
|
73
65
|
resource_type: 'gce_instance'
|
|
@@ -541,21 +533,9 @@ module Fluent
|
|
|
541
533
|
@resource ||= determine_agent_level_monitored_resource_via_legacy
|
|
542
534
|
|
|
543
535
|
# Set regexp that we should match tags against later on. Using a list
|
|
544
|
-
# instead of a map to ensure order.
|
|
545
|
-
# against Cloud Functions first, then GKE.
|
|
536
|
+
# instead of a map to ensure order.
|
|
546
537
|
@tag_regexp_list = []
|
|
547
538
|
if @resource.type == GKE_CONSTANTS[:resource_type]
|
|
548
|
-
# We only support Cloud Functions logs for GKE right now.
|
|
549
|
-
if fetch_gce_metadata('instance/attributes/'
|
|
550
|
-
).split.include?('gcf_region')
|
|
551
|
-
# Fetch this info and store it to avoid recurring
|
|
552
|
-
# metadata server calls.
|
|
553
|
-
@gcf_region = fetch_gce_metadata('instance/attributes/gcf_region')
|
|
554
|
-
@tag_regexp_list << [
|
|
555
|
-
CLOUDFUNCTIONS_CONSTANTS[:resource_type],
|
|
556
|
-
@compiled_cloudfunctions_tag_regexp
|
|
557
|
-
]
|
|
558
|
-
end
|
|
559
539
|
@tag_regexp_list << [
|
|
560
540
|
GKE_CONSTANTS[:resource_type], @compiled_kubernetes_tag_regexp
|
|
561
541
|
]
|
|
@@ -667,8 +647,7 @@ module Fluent
|
|
|
667
647
|
end
|
|
668
648
|
end
|
|
669
649
|
|
|
670
|
-
ts_secs, ts_nanos = compute_timestamp(
|
|
671
|
-
entry_level_resource.type, record, time)
|
|
650
|
+
ts_secs, ts_nanos = compute_timestamp(record, time)
|
|
672
651
|
severity = compute_severity(
|
|
673
652
|
entry_level_resource.type, record, entry_level_common_labels)
|
|
674
653
|
|
|
@@ -1087,14 +1066,6 @@ module Fluent
|
|
|
1087
1066
|
@compiled_kubernetes_tag_regexp = Regexp.new(@kubernetes_tag_regexp) if
|
|
1088
1067
|
@kubernetes_tag_regexp
|
|
1089
1068
|
|
|
1090
|
-
@compiled_cloudfunctions_tag_regexp =
|
|
1091
|
-
/\.(?<encoded_function_name>.+)\.\d+-[^-]+_default_worker$/
|
|
1092
|
-
@compiled_cloudfunctions_log_regexp = /^
|
|
1093
|
-
(?:\[(?<severity>.)\])?
|
|
1094
|
-
\[(?<timestamp>.{24})\]
|
|
1095
|
-
(?:\[(?<execution_id>[^\]]+)\])?
|
|
1096
|
-
[ ](?<text>.*)$/x
|
|
1097
|
-
|
|
1098
1069
|
@compiled_http_latency_regexp =
|
|
1099
1070
|
/^\s*(?<seconds>\d+)(?<decimal>\.\d+)?\s*s\s*$/
|
|
1100
1071
|
end
|
|
@@ -1308,7 +1279,7 @@ module Fluent
|
|
|
1308
1279
|
chunk.msgpack_each do |tag, time, record|
|
|
1309
1280
|
unless record.is_a?(Hash)
|
|
1310
1281
|
@log.warn 'Dropping log entries with malformed record: ' \
|
|
1311
|
-
"'#{record.inspect}'. " \
|
|
1282
|
+
"'#{record.inspect}' from tag '#{tag}' at '#{time}'. " \
|
|
1312
1283
|
'A log record should be in JSON format.'
|
|
1313
1284
|
next
|
|
1314
1285
|
end
|
|
@@ -1364,23 +1335,6 @@ module Fluent
|
|
|
1364
1335
|
|
|
1365
1336
|
# Once the resource type is settled down, determine the labels.
|
|
1366
1337
|
case resource.type
|
|
1367
|
-
# Cloud Functions.
|
|
1368
|
-
when CLOUDFUNCTIONS_CONSTANTS[:resource_type]
|
|
1369
|
-
resource.labels.merge!(
|
|
1370
|
-
'region' => @gcf_region,
|
|
1371
|
-
'function_name' => decode_cloudfunctions_function_name(
|
|
1372
|
-
matched_regexp_group['encoded_function_name'])
|
|
1373
|
-
)
|
|
1374
|
-
instance_id = resource.labels.delete('instance_id')
|
|
1375
|
-
common_labels.merge!(
|
|
1376
|
-
"#{GKE_CONSTANTS[:service]}/instance_id" => instance_id,
|
|
1377
|
-
"#{COMPUTE_CONSTANTS[:service]}/resource_id" => instance_id,
|
|
1378
|
-
"#{GKE_CONSTANTS[:service]}/cluster_name" =>
|
|
1379
|
-
resource.labels.delete('cluster_name'),
|
|
1380
|
-
"#{COMPUTE_CONSTANTS[:service]}/zone" =>
|
|
1381
|
-
resource.labels.delete('zone')
|
|
1382
|
-
)
|
|
1383
|
-
|
|
1384
1338
|
# GKE container.
|
|
1385
1339
|
when GKE_CONSTANTS[:resource_type]
|
|
1386
1340
|
if matched_regexp_group
|
|
@@ -1475,17 +1429,6 @@ module Fluent
|
|
|
1475
1429
|
common_labels = group_level_common_labels.dup
|
|
1476
1430
|
|
|
1477
1431
|
case resource.type
|
|
1478
|
-
# Cloud Functions.
|
|
1479
|
-
when CLOUDFUNCTIONS_CONSTANTS[:resource_type]
|
|
1480
|
-
if record.key?('log')
|
|
1481
|
-
@cloudfunctions_log_match =
|
|
1482
|
-
@compiled_cloudfunctions_log_regexp.match(record['log'])
|
|
1483
|
-
common_labels['execution_id'] =
|
|
1484
|
-
@cloudfunctions_log_match['execution_id'] if
|
|
1485
|
-
@cloudfunctions_log_match &&
|
|
1486
|
-
@cloudfunctions_log_match['execution_id']
|
|
1487
|
-
end
|
|
1488
|
-
|
|
1489
1432
|
# GKE container.
|
|
1490
1433
|
when GKE_CONSTANTS[:resource_type]
|
|
1491
1434
|
# Move the stdout/stderr annotation from the record into a label.
|
|
@@ -1627,7 +1570,7 @@ module Fluent
|
|
|
1627
1570
|
nil
|
|
1628
1571
|
end
|
|
1629
1572
|
|
|
1630
|
-
def compute_timestamp(
|
|
1573
|
+
def compute_timestamp(record, time)
|
|
1631
1574
|
current_time = Time.now
|
|
1632
1575
|
if record.key?('timestamp') &&
|
|
1633
1576
|
record['timestamp'].is_a?(Hash) &&
|
|
@@ -1655,12 +1598,6 @@ module Fluent
|
|
|
1655
1598
|
'timestampSeconds and timestampNanos instead.'
|
|
1656
1599
|
end
|
|
1657
1600
|
timestamp = time_or_nil(ts_secs, ts_nanos)
|
|
1658
|
-
elsif resource_type == CLOUDFUNCTIONS_CONSTANTS[:resource_type] &&
|
|
1659
|
-
@cloudfunctions_log_match
|
|
1660
|
-
timestamp = DateTime.parse(
|
|
1661
|
-
@cloudfunctions_log_match['timestamp']).to_time
|
|
1662
|
-
ts_secs = timestamp.tv_sec
|
|
1663
|
-
ts_nanos = timestamp.tv_nsec
|
|
1664
1601
|
elsif record.key?('time')
|
|
1665
1602
|
# k8s ISO8601 timestamp
|
|
1666
1603
|
begin
|
|
@@ -1718,14 +1655,7 @@ module Fluent
|
|
|
1718
1655
|
end
|
|
1719
1656
|
|
|
1720
1657
|
def compute_severity(resource_type, record, entry_level_common_labels)
|
|
1721
|
-
if
|
|
1722
|
-
if @cloudfunctions_log_match && @cloudfunctions_log_match['severity']
|
|
1723
|
-
return parse_severity(@cloudfunctions_log_match['severity'])
|
|
1724
|
-
elsif record.key?('stream')
|
|
1725
|
-
return CLOUDFUNCTIONS_CONSTANTS[:stream_severity_map].fetch(
|
|
1726
|
-
record.delete('stream'), 'DEFAULT')
|
|
1727
|
-
end
|
|
1728
|
-
elsif record.key?('severity')
|
|
1658
|
+
if record.key?('severity')
|
|
1729
1659
|
return parse_severity(record.delete('severity'))
|
|
1730
1660
|
elsif resource_type == GKE_CONSTANTS[:resource_type]
|
|
1731
1661
|
stream = entry_level_common_labels["#{GKE_CONSTANTS[:service]}/stream"]
|
|
@@ -1946,14 +1876,6 @@ module Fluent
|
|
|
1946
1876
|
end
|
|
1947
1877
|
end
|
|
1948
1878
|
|
|
1949
|
-
def decode_cloudfunctions_function_name(function_name)
|
|
1950
|
-
function_name.gsub(/c\.[a-z]/) { |s| s.upcase[-1] }
|
|
1951
|
-
.gsub('u.u', '_')
|
|
1952
|
-
.gsub('d.d', '$')
|
|
1953
|
-
.gsub('a.a', '@')
|
|
1954
|
-
.gsub('p.p', '.')
|
|
1955
|
-
end
|
|
1956
|
-
|
|
1957
1879
|
def format(tag, time, record)
|
|
1958
1880
|
Fluent::Engine.msgpack_factory.packer.write([tag, time, record]).to_s
|
|
1959
1881
|
end
|
|
@@ -2035,19 +1957,11 @@ module Fluent
|
|
|
2035
1957
|
# Only one of {text_payload, json_payload} will be set.
|
|
2036
1958
|
text_payload = nil
|
|
2037
1959
|
json_payload = nil
|
|
2038
|
-
#
|
|
2039
|
-
#
|
|
2040
|
-
#
|
|
2041
|
-
#
|
|
2042
|
-
|
|
2043
|
-
# 3. The only remaining key is 'message'
|
|
2044
|
-
if resource_type == CLOUDFUNCTIONS_CONSTANTS[:resource_type] &&
|
|
2045
|
-
@cloudfunctions_log_match
|
|
2046
|
-
text_payload = @cloudfunctions_log_match['text']
|
|
2047
|
-
elsif resource_type == CLOUDFUNCTIONS_CONSTANTS[:resource_type] &&
|
|
2048
|
-
record.key?('log')
|
|
2049
|
-
text_payload = record['log']
|
|
2050
|
-
elsif is_json
|
|
1960
|
+
# Use JSON if we found valid JSON, or text payload in the following
|
|
1961
|
+
# cases:
|
|
1962
|
+
# 1. This is an unstructured Container log and the 'log' key is available
|
|
1963
|
+
# 2. The only remaining key is 'message'
|
|
1964
|
+
if is_json
|
|
2051
1965
|
json_payload = record
|
|
2052
1966
|
elsif [GKE_CONSTANTS[:resource_type],
|
|
2053
1967
|
DOCKER_CONSTANTS[:resource_type]].include?(resource_type) &&
|
|
@@ -2076,9 +1990,7 @@ module Fluent
|
|
|
2076
1990
|
end
|
|
2077
1991
|
|
|
2078
1992
|
def log_name(tag, resource)
|
|
2079
|
-
if resource.type ==
|
|
2080
|
-
tag = 'cloud-functions'
|
|
2081
|
-
elsif resource.type == APPENGINE_CONSTANTS[:resource_type]
|
|
1993
|
+
if resource.type == APPENGINE_CONSTANTS[:resource_type]
|
|
2082
1994
|
# Add a prefix to Managed VM logs to prevent namespace collisions.
|
|
2083
1995
|
tag = "#{APPENGINE_CONSTANTS[:service]}/#{tag}"
|
|
2084
1996
|
elsif resource.type == GKE_CONSTANTS[:resource_type]
|
data/test/plugin/base_test.rb
CHANGED
|
@@ -1223,70 +1223,6 @@ module BaseTest
|
|
|
1223
1223
|
end
|
|
1224
1224
|
end
|
|
1225
1225
|
|
|
1226
|
-
def test_cloudfunctions_log
|
|
1227
|
-
setup_gce_metadata_stubs
|
|
1228
|
-
setup_cloudfunctions_metadata_stubs
|
|
1229
|
-
[1, 2, 3, 5, 11, 50].each do |n|
|
|
1230
|
-
setup_logging_stubs do
|
|
1231
|
-
d = create_driver(APPLICATION_DEFAULT_CONFIG, CLOUDFUNCTIONS_TAG)
|
|
1232
|
-
# The test driver doesn't clear its buffer of entries after running, so
|
|
1233
|
-
# do it manually here.
|
|
1234
|
-
d.instance_variable_get('@entries').clear
|
|
1235
|
-
@logs_sent = []
|
|
1236
|
-
n.times { |i| d.emit(cloudfunctions_log_entry(i)) }
|
|
1237
|
-
d.run
|
|
1238
|
-
end
|
|
1239
|
-
verify_log_entries(n, CLOUDFUNCTIONS_PARAMS) do |entry, i|
|
|
1240
|
-
verify_default_log_entry_text(entry['textPayload'], i, entry)
|
|
1241
|
-
assert_equal 'DEBUG', entry['severity'],
|
|
1242
|
-
"Test with #{n} logs failed. \n#{entry}"
|
|
1243
|
-
end
|
|
1244
|
-
end
|
|
1245
|
-
end
|
|
1246
|
-
|
|
1247
|
-
def test_cloudfunctions_logs_text_not_matched
|
|
1248
|
-
setup_gce_metadata_stubs
|
|
1249
|
-
setup_cloudfunctions_metadata_stubs
|
|
1250
|
-
[1, 2, 3, 5, 11, 50].each do |n|
|
|
1251
|
-
@logs_sent = []
|
|
1252
|
-
setup_logging_stubs do
|
|
1253
|
-
d = create_driver(APPLICATION_DEFAULT_CONFIG, CLOUDFUNCTIONS_TAG)
|
|
1254
|
-
# The test driver doesn't clear its buffer of entries after running, so
|
|
1255
|
-
# do it manually here.
|
|
1256
|
-
d.instance_variable_get('@entries').clear
|
|
1257
|
-
n.times { |i| d.emit(cloudfunctions_log_entry_text_not_matched(i)) }
|
|
1258
|
-
d.run
|
|
1259
|
-
end
|
|
1260
|
-
verify_log_entries(
|
|
1261
|
-
n, CLOUDFUNCTIONS_TEXT_NOT_MATCHED_PARAMS) do |entry|
|
|
1262
|
-
assert_equal 'INFO', entry['severity'],
|
|
1263
|
-
"Test with #{n} logs failed. \n#{entry}"
|
|
1264
|
-
end
|
|
1265
|
-
end
|
|
1266
|
-
end
|
|
1267
|
-
|
|
1268
|
-
def test_multiple_cloudfunctions_logs_tag_not_matched
|
|
1269
|
-
setup_gce_metadata_stubs
|
|
1270
|
-
setup_cloudfunctions_metadata_stubs
|
|
1271
|
-
[1, 2, 3, 5, 11, 50].each do |n|
|
|
1272
|
-
@logs_sent = []
|
|
1273
|
-
setup_logging_stubs do
|
|
1274
|
-
d = create_driver(APPLICATION_DEFAULT_CONFIG, CONTAINER_TAG)
|
|
1275
|
-
# The test driver doesn't clear its buffer of entries after running, so
|
|
1276
|
-
# do it manually here.
|
|
1277
|
-
d.instance_variable_get('@entries').clear
|
|
1278
|
-
n.times { |i| d.emit(cloudfunctions_log_entry(i)) }
|
|
1279
|
-
d.run
|
|
1280
|
-
end
|
|
1281
|
-
verify_log_entries(n, CONTAINER_FROM_TAG_PARAMS, 'textPayload') \
|
|
1282
|
-
do |entry, i|
|
|
1283
|
-
assert_equal '[D][2015-09-25T12:34:56.789Z][123-0] test log entry ' \
|
|
1284
|
-
"#{i}", entry['textPayload'],
|
|
1285
|
-
"Test with #{n} logs failed. \n#{entry}"
|
|
1286
|
-
end
|
|
1287
|
-
end
|
|
1288
|
-
end
|
|
1289
|
-
|
|
1290
1226
|
def test_dataproc_log
|
|
1291
1227
|
setup_gce_metadata_stubs
|
|
1292
1228
|
setup_dataproc_metadata_stubs
|
|
@@ -2173,18 +2109,6 @@ module BaseTest
|
|
|
2173
2109
|
end
|
|
2174
2110
|
end
|
|
2175
2111
|
|
|
2176
|
-
def setup_cloudfunctions_metadata_stubs
|
|
2177
|
-
stub_metadata_request(
|
|
2178
|
-
'instance/attributes/',
|
|
2179
|
-
"attribute1\ncluster-location\ncluster-name\ngcf_region\nlast_attribute")
|
|
2180
|
-
stub_metadata_request('instance/attributes/cluster-location',
|
|
2181
|
-
K8S_LOCATION2)
|
|
2182
|
-
stub_metadata_request('instance/attributes/cluster-name',
|
|
2183
|
-
K8S_CLUSTER_NAME)
|
|
2184
|
-
stub_metadata_request('instance/attributes/gcf_region',
|
|
2185
|
-
CLOUDFUNCTIONS_REGION)
|
|
2186
|
-
end
|
|
2187
|
-
|
|
2188
2112
|
def setup_dataproc_metadata_stubs
|
|
2189
2113
|
stub_metadata_request(
|
|
2190
2114
|
'instance/attributes/',
|
|
@@ -2339,20 +2263,6 @@ module BaseTest
|
|
|
2339
2263
|
}
|
|
2340
2264
|
end
|
|
2341
2265
|
|
|
2342
|
-
def cloudfunctions_log_entry(i)
|
|
2343
|
-
{
|
|
2344
|
-
stream: 'stdout',
|
|
2345
|
-
log: '[D][2015-09-25T12:34:56.789Z][123-0] ' + log_entry(i)
|
|
2346
|
-
}
|
|
2347
|
-
end
|
|
2348
|
-
|
|
2349
|
-
def cloudfunctions_log_entry_text_not_matched(i)
|
|
2350
|
-
{
|
|
2351
|
-
stream: 'stdout',
|
|
2352
|
-
log: log_entry(i)
|
|
2353
|
-
}
|
|
2354
|
-
end
|
|
2355
|
-
|
|
2356
2266
|
def dataflow_log_entry(i)
|
|
2357
2267
|
{
|
|
2358
2268
|
step: DATAFLOW_STEP_ID,
|
data/test/plugin/constants.rb
CHANGED
|
@@ -178,16 +178,6 @@ module Constants
|
|
|
178
178
|
CONTAINER_SEVERITY = 'INFO'.freeze
|
|
179
179
|
CONTAINER_LOCAL_RESOURCE_ID_PREFIX = 'gke_container'.freeze
|
|
180
180
|
|
|
181
|
-
# Cloud Functions specific labels.
|
|
182
|
-
CLOUDFUNCTIONS_FUNCTION_NAME = '$My_Function.Name-@1'.freeze
|
|
183
|
-
CLOUDFUNCTIONS_REGION = 'us-central1'.freeze
|
|
184
|
-
CLOUDFUNCTIONS_EXECUTION_ID = '123-0'.freeze
|
|
185
|
-
CLOUDFUNCTIONS_CLUSTER_NAME = 'cluster-1'.freeze
|
|
186
|
-
CLOUDFUNCTIONS_NAMESPACE_NAME = 'default'.freeze
|
|
187
|
-
CLOUDFUNCTIONS_POD_NAME =
|
|
188
|
-
'd.dc.myu.uc.functionp.pc.name-a.a1.987-c0l82'.freeze
|
|
189
|
-
CLOUDFUNCTIONS_CONTAINER_NAME = 'worker'.freeze
|
|
190
|
-
|
|
191
181
|
# Dataflow specific labels.
|
|
192
182
|
DATAFLOW_REGION = 'us-central1'.freeze
|
|
193
183
|
DATAFLOW_JOB_NAME = 'job_name_1'.freeze
|
|
@@ -709,52 +699,6 @@ module Constants
|
|
|
709
699
|
DOCKER_CONTAINER_PARAMS_NO_STREAM =
|
|
710
700
|
DOCKER_CONTAINER_PARAMS.merge(labels: {}).freeze
|
|
711
701
|
|
|
712
|
-
# Cloud Functions.
|
|
713
|
-
CLOUDFUNCTIONS_TAG = "kubernetes.#{CLOUDFUNCTIONS_POD_NAME}_" \
|
|
714
|
-
"#{CLOUDFUNCTIONS_NAMESPACE_NAME}_" \
|
|
715
|
-
"#{CLOUDFUNCTIONS_CONTAINER_NAME}".freeze
|
|
716
|
-
|
|
717
|
-
CLOUDFUNCTIONS_PARAMS = {
|
|
718
|
-
resource: {
|
|
719
|
-
type: CLOUDFUNCTIONS_CONSTANTS[:resource_type],
|
|
720
|
-
labels: {
|
|
721
|
-
'function_name' => CLOUDFUNCTIONS_FUNCTION_NAME,
|
|
722
|
-
'region' => CLOUDFUNCTIONS_REGION
|
|
723
|
-
}
|
|
724
|
-
},
|
|
725
|
-
log_name: 'cloud-functions',
|
|
726
|
-
project_id: PROJECT_ID,
|
|
727
|
-
labels: {
|
|
728
|
-
'execution_id' => CLOUDFUNCTIONS_EXECUTION_ID,
|
|
729
|
-
"#{GKE_CONSTANTS[:service]}/instance_id" => VM_ID,
|
|
730
|
-
"#{GKE_CONSTANTS[:service]}/cluster_name" =>
|
|
731
|
-
CLOUDFUNCTIONS_CLUSTER_NAME,
|
|
732
|
-
"#{COMPUTE_CONSTANTS[:service]}/resource_id" => VM_ID,
|
|
733
|
-
"#{COMPUTE_CONSTANTS[:service]}/resource_name" => HOSTNAME,
|
|
734
|
-
"#{COMPUTE_CONSTANTS[:service]}/zone" => ZONE
|
|
735
|
-
}
|
|
736
|
-
}.freeze
|
|
737
|
-
|
|
738
|
-
CLOUDFUNCTIONS_TEXT_NOT_MATCHED_PARAMS = {
|
|
739
|
-
resource: {
|
|
740
|
-
type: CLOUDFUNCTIONS_CONSTANTS[:resource_type],
|
|
741
|
-
labels: {
|
|
742
|
-
'function_name' => CLOUDFUNCTIONS_FUNCTION_NAME,
|
|
743
|
-
'region' => CLOUDFUNCTIONS_REGION
|
|
744
|
-
}
|
|
745
|
-
},
|
|
746
|
-
log_name: 'cloud-functions',
|
|
747
|
-
project_id: PROJECT_ID,
|
|
748
|
-
labels: {
|
|
749
|
-
"#{GKE_CONSTANTS[:service]}/instance_id" => VM_ID,
|
|
750
|
-
"#{GKE_CONSTANTS[:service]}/cluster_name" =>
|
|
751
|
-
CLOUDFUNCTIONS_CLUSTER_NAME,
|
|
752
|
-
"#{COMPUTE_CONSTANTS[:service]}/resource_id" => VM_ID,
|
|
753
|
-
"#{COMPUTE_CONSTANTS[:service]}/resource_name" => HOSTNAME,
|
|
754
|
-
"#{COMPUTE_CONSTANTS[:service]}/zone" => ZONE
|
|
755
|
-
}
|
|
756
|
-
}.freeze
|
|
757
|
-
|
|
758
702
|
# Cloud Dataflow.
|
|
759
703
|
DATAFLOW_PARAMS = {
|
|
760
704
|
resource: {
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-google-cloud
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stackdriver Agents Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-06-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fluentd
|
|
@@ -260,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
260
260
|
version: '0'
|
|
261
261
|
requirements: []
|
|
262
262
|
rubyforge_project:
|
|
263
|
-
rubygems_version: 2.7.
|
|
263
|
+
rubygems_version: 2.7.10
|
|
264
264
|
signing_key:
|
|
265
265
|
specification_version: 4
|
|
266
266
|
summary: fluentd plugins for the Stackdriver Logging API
|