fluent-plugin-google-cloud 0.6.4.pre.2 → 0.6.4.pre.3

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: e87c18a3faae1b0b748c947487bac806f9af22ff
4
- data.tar.gz: 7aa3fb16a6625f55e86dd7a1b2b983ce090b0803
3
+ metadata.gz: dacc67fcefff073a113c1c73ef7644ae802916e9
4
+ data.tar.gz: b2caa333b793ae00c8541e8b0c475fd0e71824a3
5
5
  SHA512:
6
- metadata.gz: 16e3e4c2db4dc5dccc26c403bd1a64802afa7fd97fa0a9bdc3109a583d865c594958efeb7e769a7aa45987d237f4842ecadb18280c6c6adc87ee6bee2a1a34b6
7
- data.tar.gz: 07a36c3637028e394f84f01baa05650f6d8db4260db6b64dae92ff7d1f4b6af6bca3173162bcbb588dffbc765e9426c24588ef30523d1dd29e0f6f1ca13d502c
6
+ metadata.gz: ee282c69851a0bf8dee3e2110f7a6635016c573af24f1b0757cf8d0a541b2396560976e8a064950087fc601a90441983dabb6312465d7873f90509236047717c
7
+ data.tar.gz: 5142fb67ba45c13759dfdd79d15f7e1cbfdf1a354da1423c2442bffc21003a1177410cbd8cb6c85495b9a501a3a74ea70a8dd1c87397199d38c1b7d74810640a
@@ -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.4.pre.2'
13
+ gem.version = '0.6.4.pre.3'
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')
@@ -19,7 +19,7 @@ eos
19
19
  gem.test_files = gem.files.grep(/^(test)/)
20
20
  gem.require_paths = ['lib']
21
21
 
22
- gem.add_runtime_dependency 'excon', '~> 0.56.0'
22
+ gem.add_runtime_dependency 'excon', '~> 0.57.1'
23
23
  gem.add_runtime_dependency 'fluentd', '~> 0.10'
24
24
  gem.add_runtime_dependency 'googleapis-common-protos', '~> 1.3'
25
25
  gem.add_runtime_dependency 'google-api-client', '~> 0.9.0'
@@ -85,6 +85,11 @@ module Fluent
85
85
  # resource can be implicitly inferred by Metadata Agent.
86
86
  IMPLICIT_MONITORED_RESOURCE_UNIQUE_KEY = ''
87
87
 
88
+ # The label name of locally unique id in the json payload. When a record
89
+ # has this field in the payload, we will use the value to retrieve
90
+ # monitored resource from Stackdriver Metadata agent.
91
+ LOCALLY_UNIQUE_ID_LABEL_NAME = 'logging.googleapis.com/locally_unique_id'
92
+
88
93
  # Docker container support.
89
94
  DEFAULT_DOCKER_API_SOCKET_PATH = '/var/run/docker.sock'
90
95
  end
@@ -94,7 +99,7 @@ module Fluent
94
99
  Fluent::Plugin.register_output('google_cloud', self)
95
100
 
96
101
  PLUGIN_NAME = 'Fluentd Google Cloud Logging plugin'
97
- PLUGIN_VERSION = '0.6.4.pre.2'
102
+ PLUGIN_VERSION = '0.6.4.pre.3'
98
103
 
99
104
  # Name of the the Google cloud logging write scope.
100
105
  LOGGING_SCOPE = 'https://www.googleapis.com/auth/logging.write'
@@ -362,6 +367,10 @@ module Fluent
362
367
  grouped_entries = {}
363
368
  chunk.msgpack_each do |tag, *arr|
364
369
  sanitized_tag = sanitize_tag(tag)
370
+ @log.error("tag is: ")
371
+ @log.error(tag.inspect)
372
+ @log.error("arr is: ")
373
+ @log.error(arr.inspect)
365
374
  if sanitized_tag.nil?
366
375
  @log.warn "Dropping log entries with invalid tag: '#{tag}'. " \
367
376
  'A tag should be a string with utf8 characters.'
@@ -880,12 +889,9 @@ module Fluent
880
889
  labels["#{COMPUTE_CONSTANTS[:service]}/resource_name"] = @vm_name
881
890
  labels["#{COMPUTE_CONSTANTS[:service]}/zone"] = @zone
882
891
 
883
- # GCE.
884
- when COMPUTE_CONSTANTS[:resource_type]
885
- labels["#{COMPUTE_CONSTANTS[:service]}/resource_name"] = @vm_name
886
-
887
- # GKE container.
888
- when CONTAINER_CONSTANTS[:resource_type]
892
+ # GCE and GKE container.
893
+ when COMPUTE_CONSTANTS[:resource_type],
894
+ CONTAINER_CONSTANTS[:resource_type]
889
895
  labels["#{COMPUTE_CONSTANTS[:service]}/resource_name"] = @vm_name
890
896
 
891
897
  # Cloud Dataflow and Cloud Dataproc.
@@ -1099,36 +1105,35 @@ module Fluent
1099
1105
  resource_labels = {}
1100
1106
  common_labels = {}
1101
1107
 
1102
- if record.key?("#{CONTAINER_CONSTANTS[:service]}/namespace_id") &&
1103
- record.key?("#{CONTAINER_CONSTANTS[:service]}/pod_name") &&
1104
- record.key?("#{CONTAINER_CONSTANTS[:service]}/container_name")
1105
- if @enable_metadata_agent
1106
- # Call Metadata Agent with "gke_containerName.<namespace_id>.
1107
- # <pod_name>.<container_name>" as the locally-unique key to retrieve
1108
- # monitored resource.
1109
- locally_unique_id = 'gke_containerName.' \
1110
- "#{record["#{CONTAINER_CONSTANTS[:service]}/namespace_id"]}." \
1111
- "#{record["#{CONTAINER_CONSTANTS[:service]}/pod_name"]}." \
1112
- "#{record["#{CONTAINER_CONSTANTS[:service]}/container_name"]}"
1113
- @log.debug 'Calling metadata agent with locally unique id: ' \
1114
- "#{locally_unique_id}."
1115
- retrieved_resource = call_metadata_agent_for_monitored_resource(
1116
- locally_unique_id)
1117
- @log.debug 'Retrieved monitored resource from metadata agent: ' \
1118
- "#{retrieved_resource.inspect}."
1119
- unless retrieved_resource.nil?
1120
- # Temporarily renaming 'gke_container' to 'container'.
1121
- # resource_type = retrieved_resource.type
1122
- resource_type = 'container'
1123
- # If we successfully get a monitored resource from Metadata Agent,
1124
- # use this one instead of the original VM-level monitored resource.
1125
- resource_labels = retrieved_resource.labels.dup
1126
- record.delete("#{CONTAINER_CONSTANTS[:service]}/namespace_id")
1127
- record.delete("#{CONTAINER_CONSTANTS[:service]}/pod_name")
1128
- record.delete("#{CONTAINER_CONSTANTS[:service]}/container_name")
1129
- @log.debug 'Retrieved gke monitored resource from Metadata ' \
1130
- "Agent: ' #{retrieved_resource.inspect}."
1131
- end
1108
+ # The format of the locally unique key varies by monitored resource.
1109
+ #
1110
+ # Docker container:
1111
+ # "container.<container_id>"
1112
+ # "containerName.<container_name>"
1113
+ # GKE container:
1114
+ # "gke_containerName.<namespace_id>.<pod_name>.<container_name>"
1115
+ if @enable_metadata_agent && record.key?(LOCALLY_UNIQUE_ID_LABEL_NAME)
1116
+ # Call Metadata Agent with "gke_containerName.<namespace_id>.
1117
+ # <pod_name>.<container_name>" as the locally-unique key to retrieve
1118
+ # monitored resource.
1119
+ locally_unique_id = record[LOCALLY_UNIQUE_ID_LABEL_NAME]
1120
+ @log.debug 'Calling metadata agent with locally unique id: ' \
1121
+ "#{locally_unique_id}."
1122
+ retrieved_resource = call_metadata_agent_for_monitored_resource(
1123
+ locally_unique_id)
1124
+ @log.debug 'Retrieved monitored resource from metadata agent: ' \
1125
+ "#{retrieved_resource.inspect}."
1126
+ unless retrieved_resource.nil?
1127
+ resource_type = retrieved_resource.type
1128
+ # Temporarily renaming 'gke_container' to 'container'.
1129
+ resource_type = 'container' if resource_type == 'gke_container'
1130
+ # If we successfully get a monitored resource from Metadata Agent,
1131
+ # use this one instead of the original VM-level monitored resource.
1132
+ resource_labels = retrieved_resource.labels.dup
1133
+ record.delete(LOCALLY_UNIQUE_ID_LABEL_NAME)
1134
+ @log.debug 'Retrieved gke_container monitored resource from' \
1135
+ 'Stackdriver Metadata agent: ' \
1136
+ "#{retrieved_resource.inspect}."
1132
1137
  end
1133
1138
  end
1134
1139
 
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.pre.2
4
+ version: 0.6.4.pre.3
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-07-18 00:00:00.000000000 Z
12
+ date: 2017-07-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.56.0
20
+ version: 0.57.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.56.0
27
+ version: 0.57.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: fluentd
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -212,7 +212,6 @@ extra_rdoc_files: []
212
212
  files:
213
213
  - CONTRIBUTING
214
214
  - Gemfile
215
- - Gemfile.lock
216
215
  - LICENSE
217
216
  - README.rdoc
218
217
  - Rakefile
@@ -1,157 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- fluent-plugin-google-cloud (0.6.4.pre.2)
5
- excon (~> 0.56.0)
6
- fluentd (~> 0.10)
7
- google-api-client (~> 0.9.0)
8
- google-cloud-logging (~> 0.23.2)
9
- googleapis-common-protos (~> 1.3)
10
- googleauth (~> 0.4)
11
- grpc (~> 1.0, < 1.3)
12
- json (~> 1.8)
13
-
14
- GEM
15
- remote: https://rubygems.org/
16
- specs:
17
- addressable (2.5.1)
18
- public_suffix (~> 2.0, >= 2.0.2)
19
- ast (2.3.0)
20
- astrolabe (1.3.1)
21
- parser (~> 2.2)
22
- cool.io (1.5.0)
23
- crack (0.4.3)
24
- safe_yaml (~> 1.0.0)
25
- excon (0.56.0)
26
- faraday (0.12.1)
27
- multipart-post (>= 1.2, < 3)
28
- fluentd (0.14.19)
29
- cool.io (>= 1.4.5, < 2.0.0)
30
- http_parser.rb (>= 0.5.1, < 0.7.0)
31
- msgpack (>= 0.7.0, < 2.0.0)
32
- serverengine (>= 2.0.4, < 3.0.0)
33
- sigdump (~> 0.2.2)
34
- strptime (~> 0.1.7)
35
- tzinfo (~> 1.0)
36
- tzinfo-data (~> 1.0)
37
- yajl-ruby (~> 1.0)
38
- google-api-client (0.9.28)
39
- addressable (~> 2.3)
40
- googleauth (~> 0.5)
41
- httpclient (~> 2.7)
42
- hurley (~> 0.1)
43
- memoist (~> 0.11)
44
- mime-types (>= 1.6)
45
- representable (~> 2.3.0)
46
- retriable (~> 2.0)
47
- google-cloud-core (0.21.1)
48
- googleauth (~> 0.5.1)
49
- google-cloud-logging (0.23.2)
50
- google-cloud-core (~> 0.21.1)
51
- google-gax (~> 0.6.0)
52
- google-protobuf (~> 3.0)
53
- googleapis-common-protos (~> 1.3)
54
- grpc (~> 1.0)
55
- orderedhash (= 0.0.6)
56
- stackdriver-core (~> 0.21.0)
57
- google-gax (0.6.0)
58
- googleapis-common-protos (~> 1.3.1)
59
- googleauth (~> 0.5.1)
60
- grpc (~> 1.0)
61
- rly (~> 0.2.3)
62
- google-protobuf (3.3.0)
63
- googleapis-common-protos (1.3.5)
64
- google-protobuf (~> 3.2)
65
- grpc (~> 1.0)
66
- googleauth (0.5.1)
67
- faraday (~> 0.9)
68
- jwt (~> 1.4)
69
- logging (~> 2.0)
70
- memoist (~> 0.12)
71
- multi_json (~> 1.11)
72
- os (~> 0.9)
73
- signet (~> 0.7)
74
- grpc (1.2.5)
75
- google-protobuf (~> 3.1)
76
- googleauth (~> 0.5.1)
77
- hashdiff (0.3.4)
78
- http_parser.rb (0.6.0)
79
- httpclient (2.8.3)
80
- hurley (0.2)
81
- json (1.8.6)
82
- jwt (1.5.6)
83
- little-plugger (1.1.4)
84
- logging (2.2.2)
85
- little-plugger (~> 1.1)
86
- multi_json (~> 1.10)
87
- memoist (0.16.0)
88
- metaclass (0.0.4)
89
- mime-types (3.1)
90
- mime-types-data (~> 3.2015)
91
- mime-types-data (3.2016.0521)
92
- mocha (1.2.1)
93
- metaclass (~> 0.0.1)
94
- msgpack (1.1.0)
95
- multi_json (1.12.1)
96
- multipart-post (2.0.0)
97
- orderedhash (0.0.6)
98
- os (0.9.6)
99
- parser (2.4.0.0)
100
- ast (~> 2.2)
101
- power_assert (1.0.2)
102
- powerpack (0.1.1)
103
- public_suffix (2.0.5)
104
- rainbow (2.2.2)
105
- rake
106
- rake (10.5.0)
107
- representable (2.3.0)
108
- uber (~> 0.0.7)
109
- retriable (2.1.0)
110
- rly (0.2.3)
111
- rubocop (0.35.1)
112
- astrolabe (~> 1.3)
113
- parser (>= 2.2.3.0, < 3.0)
114
- powerpack (~> 0.1)
115
- rainbow (>= 1.99.1, < 3.0)
116
- ruby-progressbar (~> 1.7)
117
- tins (<= 1.6.0)
118
- ruby-progressbar (1.8.1)
119
- safe_yaml (1.0.4)
120
- serverengine (2.0.5)
121
- sigdump (~> 0.2.2)
122
- sigdump (0.2.4)
123
- signet (0.7.3)
124
- addressable (~> 2.3)
125
- faraday (~> 0.9)
126
- jwt (~> 1.5)
127
- multi_json (~> 1.10)
128
- stackdriver-core (0.21.0)
129
- strptime (0.1.9)
130
- test-unit (3.2.5)
131
- power_assert
132
- thread_safe (0.3.6)
133
- tins (1.6.0)
134
- tzinfo (1.2.3)
135
- thread_safe (~> 0.1)
136
- tzinfo-data (1.2017.2)
137
- tzinfo (>= 1.0.0)
138
- uber (0.0.15)
139
- webmock (1.24.6)
140
- addressable (>= 2.3.6)
141
- crack (>= 0.3.2)
142
- hashdiff
143
- yajl-ruby (1.3.0)
144
-
145
- PLATFORMS
146
- ruby
147
-
148
- DEPENDENCIES
149
- fluent-plugin-google-cloud!
150
- mocha (~> 1.1)
151
- rake (~> 10.3)
152
- rubocop (~> 0.35.0)
153
- test-unit (~> 3.0)
154
- webmock (~> 1.17)
155
-
156
- BUNDLED WITH
157
- 1.15.2