fluent-plugin-datadog-log 0.1.0.rc9 → 0.1.0.rc10

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: eb7c1ae1745bd1e2cf136e146145e280abec60c7
4
- data.tar.gz: deb2d3d35eb0a37b431160f694ba2bb00511f2fd
3
+ metadata.gz: 8c9df2b279c5e9048bd66cd3a8745b846b04052e
4
+ data.tar.gz: 2b2c3fbd224a2999057149073662157030b0c8e2
5
5
  SHA512:
6
- metadata.gz: 8cf0853cfa35f60f0abe8b069ad7f1eb77a0d4bade42e619da0190f0ac0a5fe6182ba55298aaef0bb82c8fd66efd74183c3c2dd67e599028d88752f62591d683
7
- data.tar.gz: 60f773328557aa2a6cffc70439e14a58879b6dbfdba9648d1ed9825385d906e9e795e6cb083cb450d64115b4bc5bacc23a8612bdc52edfebd0c1c3f86f1f88df
6
+ metadata.gz: bd31ec06397133d8720f8e44c4775f2d0b6bdfe494b79407fddc2589f314b5eecc5d9cbc72c3a3f05f47d93b52349565d2dc98892e480aba6f75819129c7ecb9
7
+ data.tar.gz: f4d69d86c46a88f2bb067dbbcaa42be29c313a8cc39c0e93174078a40958c88ec6c44b9987638651aac23d7e739f44732f5adb9c1e3b57c78694fdb68aca115e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-datadog-log (0.1.0.rc9)
4
+ fluent-plugin-datadog-log (0.1.0.rc10)
5
5
  fluentd (~> 0.14)
6
6
  json (~> 1.8)
7
7
  net_tcp_client (~> 2.0.1)
@@ -8,7 +8,7 @@ eos
8
8
  gem.homepage = \
9
9
  'https://github.com/mumoshu/fluent-plugin-datadog-log'
10
10
  gem.license = 'Apache-2.0'
11
- gem.version = '0.1.0.rc9'
11
+ gem.version = '0.1.0.rc10'
12
12
  gem.authors = ['Yusuke KUOKA']
13
13
  gem.email = ['ykuoka@gmail.com']
14
14
  gem.required_ruby_version = Gem::Requirement.new('>= 2.0')
@@ -246,7 +246,7 @@ module Fluent::Plugin
246
246
  }
247
247
 
248
248
  mappings.each do |json_key, tag_key|
249
- tags << "#{tag_key}=#{kube[json_key]}" if kube.key? json_key
249
+ tags << "#{tag_key}:#{kube[json_key]}" if kube.key? json_key
250
250
  end
251
251
 
252
252
  kube_labels = kube['labels']
@@ -255,22 +255,22 @@ module Fluent::Plugin
255
255
  k2 = k.dup
256
256
  k2.gsub!(/[\,\.]/, '_')
257
257
  k2.gsub!(%r{/}, '-')
258
- tags << "kube_#{k2}=#{v}"
258
+ tags << "kube_#{k2}:#{v}"
259
259
  end
260
260
  end
261
261
 
262
262
  @log.debug 'Dumping kubernetes metadata', metadata: kube
263
263
 
264
- if kube.key? 'annotations'
265
- annotations = kube['annotations']
266
- created_by_str = annotations['kubernetes.io/created-by']
264
+ annotations = kube['annotations']
265
+ unless annotations.nil?
266
+ created_by_str = annotations['kubernetes_io/created-by']
267
267
  unless created_by_str.nil?
268
268
  created_by = JSON.parse(created_by_str)
269
269
  ref = created_by['reference'] unless created_by.nil?
270
270
  kind = ref['kind'] unless ref.nil?
271
271
  name = ref['name'] unless ref.nil?
272
272
  kind = kind.downcase unless kind.nil?
273
- tags << "kube_#{kind}=#{name}" if !kind.nil? && !name.nil?
273
+ tags << "kube_#{kind}:#{name}" if !kind.nil? && !name.nil?
274
274
  end
275
275
  end
276
276
 
@@ -476,7 +476,7 @@ module Fluent::Plugin
476
476
  aws_account_id = ec2_metadata['accountId'] if
477
477
  ec2_metadata.key?('accountId')
478
478
  # #host:i-09fbfed2672d2c6bf
479
- %W(host=#{@vm_id} zone=#{@zone} aws_account_id=#{aws_account_id})
479
+ %W(host:#{@vm_id} zone:#{@zone} aws_account_id:#{aws_account_id})
480
480
  .concat @tags
481
481
  end
482
482
 
@@ -92,7 +92,7 @@ class DatadogLogOutputTest < Test::Unit::TestCase
92
92
  assert_equal(1, d.logs.count { |l| l =~ /Sent payload to Datadog/ })
93
93
  assert_equal(1, conn.sent.size)
94
94
  # rubocop:disable LineLength
95
- payload = %(myapikey/mylogset <46>0 2006-01-02T15:04:05.000000+00:00 i-81c16767 myservice - - [dd ddsource="mysource"][dd ddsourcecategory="mysourcecategory"][dd ddtags="host=i-81c16767,zone=aws:us-west-2b,aws_account_id=123456789012"] mymsg\n)
95
+ payload = %(myapikey/mylogset <46>0 2006-01-02T15:04:05.000000+00:00 i-81c16767 myservice - - [dd ddsource="mysource"][dd ddsourcecategory="mysourcecategory"][dd ddtags="host:i-81c16767,zone:aws:us-west-2b,aws_account_id:123456789012"] mymsg\n)
96
96
  # rubocop:enable LineLength
97
97
  assert_equal(payload, conn.sent.first)
98
98
  end
@@ -113,7 +113,7 @@ class DatadogLogOutputTest < Test::Unit::TestCase
113
113
  source_category mysourcecategory
114
114
  logset mylogset
115
115
  log_level debug
116
- tags ["kube_cluster=MyCluster", "mykey=myval"]
116
+ tags ["kube_cluster:MyCluster", "mykey:myval"]
117
117
  EOC
118
118
  conn = StubConn.new
119
119
  fluentd_tag = 'mytag'
@@ -135,7 +135,8 @@ class DatadogLogOutputTest < Test::Unit::TestCase
135
135
  },
136
136
  'annotations' => {
137
137
  # rubocop:disable LineLength
138
- 'kubernetes.io/created-by' => '{"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"Deployment","namespace":"default","name":"myapp","uid":"d67e8857-c2dc-11e7-aed9-066d23381f8c","apiVersion":"extensions","resourceVersion":"289"}}'
138
+ # kubernetes.io is translated to kubernetes_io by kubernetes metadata filter
139
+ 'kubernetes_io/created-by' => '{"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"Deployment","namespace":"default","name":"myapp","uid":"d67e8857-c2dc-11e7-aed9-066d23381f8c","apiVersion":"extensions","resourceVersion":"289"}}'
139
140
  # rubocop:enable LineLength
140
141
  }
141
142
  }
@@ -147,7 +148,7 @@ class DatadogLogOutputTest < Test::Unit::TestCase
147
148
  assert_equal(1, d.logs.count { |l| l =~ /Sent payload to Datadog/ })
148
149
  assert_equal(1, conn.sent.size)
149
150
  # rubocop:disable LineLength
150
- payload = %(myapikey/mylogset <46>0 2006-01-02T15:04:05.000000+00:00 i-81c16767 myapp - - [dd ddsource="mypod"][dd ddsourcecategory="mycontainer"][dd ddtags="pod_name=mypod,container_name=mycontainer,kube_k8s-app=myapp,kube_deployment=myapp,host=i-81c16767,zone=aws:us-west-2b,aws_account_id=123456789012,kube_cluster=MyCluster,mykey=myval"] mymsg\n)
151
+ payload = %(myapikey/mylogset <46>0 2006-01-02T15:04:05.000000+00:00 i-81c16767 myapp - - [dd ddsource="mypod"][dd ddsourcecategory="mycontainer"][dd ddtags="pod_name:mypod,container_name:mycontainer,kube_k8s-app:myapp,kube_deployment:myapp,host:i-81c16767,zone:aws:us-west-2b,aws_account_id:123456789012,kube_cluster:MyCluster,mykey:myval"] mymsg\n)
151
152
  # rubocop:enable LineLength
152
153
  assert_equal(payload, conn.sent.first)
153
154
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-datadog-log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.rc9
4
+ version: 0.1.0.rc10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke KUOKA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -172,16 +172,6 @@ files:
172
172
  - lib/fluent/plugin/monitoring.rb
173
173
  - lib/fluent/plugin/out_datadog_log.rb
174
174
  - lib/fluent/plugin/out_datadog_log.rb~
175
- - pkg/fluent-plugin-datadog-0.1.0.gem
176
- - pkg/fluent-plugin-datadog-log-0.1.0.gem
177
- - pkg/fluent-plugin-datadog-log-0.1.0.rc1.gem
178
- - pkg/fluent-plugin-datadog-log-0.1.0.rc2.gem
179
- - pkg/fluent-plugin-datadog-log-0.1.0.rc3.gem
180
- - pkg/fluent-plugin-datadog-log-0.1.0.rc4.gem
181
- - pkg/fluent-plugin-datadog-log-0.1.0.rc5.gem
182
- - pkg/fluent-plugin-datadog-log-0.1.0.rc6.gem
183
- - pkg/fluent-plugin-datadog-log-0.1.0.rc7.gem
184
- - pkg/fluent-plugin-datadog-log-0.1.0.rc8.gem
185
175
  - test/helper.rb
186
176
  - test/plugin/base_test.rb
187
177
  - test/plugin/constants.rb
Binary file