fluent-plugin-deis-kafka 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/fluent/mixin/deis.rb +8 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c414fda72d442beb154378e4c9eb6c1b5d87a648
4
- data.tar.gz: 16bd58fb7bb0a822bb3574a0ec037d7cf10f33fd
3
+ metadata.gz: 8d1cabe61da7f602a89d4a817ffc764e24440bec
4
+ data.tar.gz: 15c427fb105d9cc188b6f15cad446f4d52d69fc3
5
5
  SHA512:
6
- metadata.gz: 4fb84eaaae243d26775b3e20b0ca0a0725f586d914db8332ccb036ff07f56a0470cd90603572c262fb9335739a22c11b1aca6170a4459f9da6c8cb28fe24aec9
7
- data.tar.gz: 0df1e72c2a52b1242018dee56bf75eeacd1fafba515594977384bfbcd7caa080c46b19ca9a30e2d57144a46ed794bc7abfee83b8868329d7ed21a6b8a22ae350
6
+ metadata.gz: 75709daeaca14773c0813ac7a77eb936afe70924c8bce4b4de007962b646a31d2db4408aba71fb63a1e6b10fff024cc2c09052a11f4d54406fe105e7bb1ecf75
7
+ data.tar.gz: 404a89d809fcc7b2351de81db23388f109a64b870dde0f190331e2e2f244388d73f5032fc89bd9286b5a03b39808ce0e5c9990372d56f4ee6a7243775dd7aad6
data/README.md CHANGED
@@ -1,2 +1,2 @@
1
1
  # fluentd-plugin-deis-kafka
2
- [![Build Status](https://travis-ci.org/topfreegames/fluent-plugin-deis-kafka.svg?branch=master)](https://travis-ci.org/topfreegames/fluent-plugin-deis-kafka) [![Dependency Status](https://gemnasium.com/badges/github.com/topfreegames/fluent-plugin-deis-kafka.svg)](https://gemnasium.com/github.com/topfreegames/fluent-plugin-deis-kafka) [![Gem Version](https://badge.fury.io/rb/fluentd.svg)](https://badge.fury.io/rb/fluentd)
2
+ [![Build Status](https://travis-ci.org/topfreegames/fluent-plugin-deis-kafka.svg?branch=master)](https://travis-ci.org/topfreegames/fluent-plugin-deis-kafka) [![Dependency Status](https://gemnasium.com/badges/github.com/topfreegames/fluent-plugin-deis-kafka.svg)](https://gemnasium.com/github.com/topfreegames/fluent-plugin-deis-kafka) [![Gem Version](https://badge.fury.io/rb/fluent-plugin-deis-kafka.svg)](https://badge.fury.io/rb/fluent-plugin-deis-kafka)
@@ -21,22 +21,26 @@ module Fluent
21
21
  def build_series(message)
22
22
  metric = parse_router_log(message['log'], message['kubernetes']['host'])
23
23
  if metric
24
+ metric_timestamp = (metric['timestamp'].to_f * 1_000_000_000).to_i
24
25
  tags = { app: metric['app'], status_code: metric['status_code'], host: metric['host'] }
25
26
  data = [
26
27
  {
27
28
  series: 'deis_router_request_time_ms',
28
29
  values: { value: metric['request_time'] },
29
- tags: tags
30
+ tags: tags,
31
+ timestamp: metric_timestamp
30
32
  },
31
33
  {
32
34
  series: 'deis_router_response_time_ms',
33
35
  values: { value: metric['response_time'] },
34
- tags: tags
36
+ tags: tags,
37
+ timestamp: metric_timestamp
35
38
  },
36
39
  {
37
40
  series: 'deis_router_bytes_sent',
38
41
  values: { value: metric['bytes_sent'] },
39
- tags: tags
42
+ tags: tags,
43
+ timestamp: metric_timestamp
40
44
  }
41
45
  ]
42
46
  return data
@@ -51,6 +55,7 @@ module Fluent
51
55
  split_message = message.split(' - ')
52
56
  return nil if split_message.length < 14
53
57
  metric = {}
58
+ metric['timestamp'] = Time.parse(split_message[0])
54
59
  metric['app'] = split_message[1].strip
55
60
  metric['status_code'] = split_message[4].strip
56
61
  metric['bytes_sent'] = split_message[6].strip.to_f
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-deis-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Souza