fluent-plugin-barito 0.1.12 → 0.1.13

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
  SHA256:
3
- metadata.gz: b16ac0a69cc8799dcaf8c984d0bc3ed0febf7b74f41fc2747a4caddf57c6cf65
4
- data.tar.gz: dec6dfe457192ff805ebb129ecc80e7c20b72e993623a1c590cf17a5007620fb
3
+ metadata.gz: e1322ed9381fdba786b7eebb34c03b0df7f8278d252321a1917afb28efc9d3b0
4
+ data.tar.gz: 1f4e5acff90c1fa78e95d23732b113ac26b40dc14729ba20d0b7cd92a811bda3
5
5
  SHA512:
6
- metadata.gz: e9c7a1c6bd1ff467a182c974e1c12513af95b5d62fe6378d7eaf894669fabe40cb19d14a6a6b5e7fa6ccbd778f8a8a4007bbd88b4e8df49a8327b8d56489536e
7
- data.tar.gz: 5f26c1ecab0fca35f120b684e3bffcd8067dd11a1021af63b0f1670620fce21fe9f3e78032ac6266c349924979cce1ed5daa6e3f1262d0c20b3bd1ddf9e67f2c
6
+ metadata.gz: 1f43f31056da179fc49b9f352ab5ca1a133c2dd033d275bafc59aaa00df76c1f8b90690cb5b026cc3bed1984f91231cc2b5cca911af583e70a54acd65d7e8452
7
+ data.tar.gz: a39189386da6918a24e1a3b2a3949895bff5c5569abeb2c57b7b4a1a2d34a7b486b2d232f24d88a19a1812acb415f5a0c21581b87dbcba89745a3be93ccea90c
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-barito"
6
- spec.version = "0.1.12"
6
+ spec.version = "0.1.13"
7
7
  spec.authors = ["BaritoLog"]
8
8
  spec.email = ["pushm0v.development@gmail.com", "iman.tung@gmail.com"]
9
9
 
@@ -1,18 +1,22 @@
1
+ require 'socket'
2
+
1
3
  class Fluent::Plugin::ClientTrail
2
4
 
3
5
  attr_accessor :is_k8s, :sent_at, :hints
4
-
6
+
5
7
  def initialize(is_k8s)
6
8
  @is_k8s = is_k8s
7
9
  @sent_at = Time.now.utc.strftime('%FT%TZ')
8
10
  @hints = []
11
+ @hostname = Socket.gethostname
9
12
  end
10
-
13
+
11
14
  def to_hash
12
15
  {
13
- 'is_k8s' => @is_k8s,
14
- 'sent_at' => @sent_at,
15
- 'hints' => @hints
16
+ 'is_k8s' => @is_k8s,
17
+ 'sent_at' => @sent_at,
18
+ 'hints' => @hints,
19
+ 'hostname' => @hostname
16
20
  }
17
21
  end
18
22
 
@@ -25,12 +25,8 @@ module Fluent
25
25
 
26
26
  # Overide from BufferedOutput
27
27
  def write(chunk)
28
-
29
- # logger = Logger.new(STDOUT)
30
-
31
28
  chunk.msgpack_each do |tag, time, record|
32
29
  trail = Fluent::Plugin::ClientTrail.new(false)
33
-
34
30
  timber = Fluent::Plugin::TimberFactory::create_timber(tag, time, record, trail)
35
31
  header = {content_type: :json, 'X-App-Secret' => @application_secret}
36
32
 
@@ -5,20 +5,12 @@ describe 'Fluent::BaritoK8sOutput' do
5
5
  describe '.produce_url' do
6
6
  it do
7
7
  k8s_labels = {
8
- Fluent::BaritoK8sOutput::LABEL_PRODUCE_HOST => 'localhost',
9
- Fluent::BaritoK8sOutput::LABEL_PRODUCE_PORT => '5000',
10
- Fluent::BaritoK8sOutput::LABEL_PRODUCE_TOPIC => 'sometopic'
8
+ Fluent::BaritoK8sOutput::LABEL_PRODUCE_URL => 'https://localhost:5000/produce/sometopic'
11
9
  }
12
10
 
13
- out1 = Fluent::BaritoK8sOutput.new
14
- out1.use_https = true
15
- url = out1.produce_url(k8s_labels)
11
+ out = Fluent::BaritoK8sOutput.new
12
+ url = out.produce_url(k8s_labels)
16
13
  expect(url).to eq 'https://localhost:5000/produce/sometopic'
17
-
18
- out2 = Fluent::BaritoK8sOutput.new
19
- out2.use_https = false
20
- url = out2.produce_url(k8s_labels)
21
- expect(url).to eq 'http://localhost:5000/produce/sometopic'
22
14
  end
23
15
 
24
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-barito
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - BaritoLog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-06 00:00:00.000000000 Z
11
+ date: 2018-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler