fluent-plugin-google-cloud 0.5.0 → 0.5.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: 1989b8ce8911575be17949674d1d8dfb137dbeda
4
- data.tar.gz: f5ac2f7ca47a5c61dfc7a32a9254b6de841a2182
3
+ metadata.gz: bae4e3edae194459b6bffe522aa070d6c96f4c01
4
+ data.tar.gz: 290eaab1b92a6cea5c9204f5892fb008c6334d57
5
5
  SHA512:
6
- metadata.gz: 9de731cc6f29055be014d6894f0b4930c7c6b5d836c149789d0ae06fe7e14a09687307485b559b6cf77335770a1f84003945468ed9b863d11c49a079142dad1a
7
- data.tar.gz: aa07feea223b293e68da01fcf7e35facef3aa3af7ce3a8ba014304479e3521129809f004bb94a342ac6a00a2ee83bb0fe4132a2caae87ecdfcc4691cf6adbb5b
6
+ metadata.gz: c8644923f32740b2aee18e0b71047c8dc6d1c881c7f590a88a7a5e136088c9eccd428bfcbe53aadaeedf6b301ecc5f6e29d9a7ec5545635b3f7a1021a2371aba
7
+ data.tar.gz: 8d101639abc752dd42a7c0dcf29bdc8834d20bbde8686e4eb3b41b6ca6c09b830e62b2a8ecc4551657eac3ef9baa5d779148358b6326dddd23749ea108a60dda
@@ -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.0'
13
+ gem.version = '0.5.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')
@@ -25,14 +25,13 @@ module Fluent
25
25
  Fluent::Plugin.register_output('google_cloud', self)
26
26
 
27
27
  PLUGIN_NAME = 'Fluentd Google Cloud Logging plugin'
28
- PLUGIN_VERSION = '0.5.0'
28
+ PLUGIN_VERSION = '0.5.1'
29
29
 
30
30
  # Constants for service names.
31
31
  APPENGINE_SERVICE = 'appengine.googleapis.com'
32
32
  CLOUDFUNCTIONS_SERVICE = 'cloudfunctions.googleapis.com'
33
33
  COMPUTE_SERVICE = 'compute.googleapis.com'
34
34
  CONTAINER_SERVICE = 'container.googleapis.com'
35
- DATAFLOW_SERVICE = 'dataflow.googleapis.com'
36
35
  EC2_SERVICE = 'ec2.amazonaws.com'
37
36
 
38
37
  # Name of the the Google cloud logging write scope.
@@ -63,13 +62,16 @@ module Fluent
63
62
  config_param :vm_id, :string, :default => nil
64
63
  config_param :vm_name, :string, :default => nil
65
64
 
66
- # Whether to try to detect of the VM is owned by a "subservice" such as App
65
+ # Whether to try to detect if the VM is owned by a "subservice" such as App
67
66
  # Engine of Kubernetes, rather than just associating the logs with the
68
67
  # compute service of the platform. This currently only has any effect when
69
68
  # running on GCE.
69
+ #
70
70
  # The initial motivation for this is to separate out Kubernetes node
71
71
  # component (Docker, Kubelet, etc.) logs from container logs.
72
72
  config_param :detect_subservice, :bool, :default => true
73
+ # The subservice_name overrides the subservice detection, if provided.
74
+ config_param :subservice_name, :string, :default => nil
73
75
 
74
76
  # The regular expression to use on Kubernetes logs to extract some basic
75
77
  # information about the log source. The regex must contain capture groups
@@ -97,6 +99,20 @@ module Fluent
97
99
  # }
98
100
  config_param :label_map, :hash, :default => nil
99
101
 
102
+ # labels (specified as a JSON object) is a set of custom labels
103
+ # provided at configuration time. It allows users to inject extra
104
+ # environmental information into every message or to customize
105
+ # labels otherwise detected automatically.
106
+ #
107
+ # Each entry in the map is a {"label_name": "label_value"} pair.
108
+ #
109
+ # Example:
110
+ # labels {
111
+ # "label_name_1": "label_value_1",
112
+ # "label_name_2": "label_value_2"
113
+ # }
114
+ config_param :labels, :hash, :default => nil
115
+
100
116
  # DEPRECATED: The following parameters, if present in the config
101
117
  # indicate that the plugin configuration must be updated.
102
118
  config_param :auth_method, :string, :default => nil
@@ -147,6 +163,7 @@ module Fluent
147
163
 
148
164
  # TODO: Send instance tags as labels as well?
149
165
  @common_labels = {}
166
+ @common_labels.merge!(@labels) if @labels
150
167
 
151
168
  @compiled_kubernetes_tag_regexp = nil
152
169
  if @kubernetes_tag_regexp
@@ -222,7 +239,9 @@ module Fluent
222
239
  case @platform
223
240
  when Platform::GCE
224
241
  @service_name = COMPUTE_SERVICE
225
- if @detect_subservice
242
+ if @subservice_name
243
+ @service_name = @subservice_name
244
+ elsif @detect_subservice
226
245
  # Check for specialized GCE environments.
227
246
  # TODO: Add config options for these to allow for running outside GCE?
228
247
  attributes = fetch_gce_metadata('instance/attributes/').split
@@ -239,11 +258,6 @@ module Fluent
239
258
  common_labels["#{APPENGINE_SERVICE}/module_id"] = @gae_backend_name
240
259
  common_labels["#{APPENGINE_SERVICE}/version_id"] =
241
260
  @gae_backend_version
242
- elsif attributes.include?('job_id')
243
- # Dataflow
244
- @service_name = DATAFLOW_SERVICE
245
- @dataflow_job_id = fetch_gce_metadata('instance/attributes/job_id')
246
- common_labels["#{DATAFLOW_SERVICE}/job_id"] = @dataflow_job_id
247
261
  elsif attributes.include?('kube-env')
248
262
  # Kubernetes/Container Engine
249
263
  @service_name = CONTAINER_SERVICE
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.0
4
+ version: 0.5.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-04-19 00:00:00.000000000 Z
12
+ date: 2016-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubyforge_project:
185
- rubygems_version: 2.6.3
185
+ rubygems_version: 2.4.8
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: fluentd output plugin for the Google Cloud Logging API